/* ---------- Fonte ---------- */
@font-face { font-family: 'Teko'; src: url('../Teko/Teko-VariableFont_wght.ttf') format('truetype'); font-weight: 300 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #121212;
  --bg-2: #1a1a1a;
  --card: #1f1f1f;
  --card-2: #262626;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #9b9b9b;
  --accent: #D7FB01;
  --accent-ink: #161616;
  --accent-dim: #6b7e01;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 14px;
  --font-head: 'Teko', 'Oswald', Impact, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 96px; /* espaço para o cronômetro */
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; letter-spacing: .01em; margin: 0; line-height: 1; }
.wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(18,18,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { font-family: var(--font-head); font-size: 30px; font-weight: 600; color: var(--accent); text-decoration: none; letter-spacing: .04em; text-transform: uppercase; line-height: 1; padding-top: 4px; }
.topnav { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill:hover { border-color: var(--accent-dim); }
.pill.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Home ---------- */
.hero { padding: 36px 0 20px; }
.hero h1 { font-size: 56px; text-transform: uppercase; }
.hero p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.person-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 20px 0; }
@media (min-width: 560px) { .person-grid { grid-template-columns: 1fr 1fr; } }
.person-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.person-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.person-card .eyebrow { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.person-card h2 { font-size: 44px; color: var(--accent); margin: 4px 0 6px; }
.person-card .today { color: var(--text); font-size: 15px; }
.person-card .today b { color: var(--accent); }

/* ---------- Cartão genérico ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 26px; margin-bottom: 8px; }
.muted { color: var(--muted); }

/* Semana / regras */
.week { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; }
.week h2 { font-size: 22px; color: var(--muted); font-weight: 400; }
.week h2 b { color: var(--text); font-weight: 600; }
details.rules { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; margin-bottom: 16px; }
details.rules summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules summary::after { content: '+'; color: var(--accent); font-size: 20px; }
details[open].rules summary::after { content: '−'; }
.rules-list { margin: 0; padding: 0 16px 14px; display: grid; gap: 10px; }
.rules-list div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.rules-list dt { color: var(--accent); font-weight: 600; }
.rules-list dd { margin: 0; color: var(--text); }
.goal { font-size: 14px; color: var(--muted); padding: 0 16px 14px; margin: 0; }

/* ---------- Dias ---------- */
.days { display: flex; gap: 6px; margin: 0 -16px 18px; padding: 0 16px 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .days { display: grid; grid-template-columns: repeat(7, 1fr); margin: 0 0 18px; padding: 0; overflow: visible; } }
.day-btn { position: relative; flex: 0 0 76px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.day-btn small { font-weight: 400; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.day-btn.is-rest { color: var(--muted); }
.day-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-btn.is-active small { color: var(--accent-ink); opacity: .75; }
.day-btn.is-today::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.day-btn.is-today.is-active::after { background: var(--accent-ink); }

.day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.day-head h1 { font-size: 48px; text-transform: uppercase; }
.day-head .sub { color: var(--muted); margin: 2px 0 0; }
.day-head .badge-today { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; }
.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.progress .bar { flex: 1; height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.notice { border-left: 3px solid var(--warn); background: var(--bg-2); padding: 10px 14px; border-radius: 0 10px 10px 0; color: var(--text); font-size: 14px; margin-bottom: 14px; }

.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--font-body); font-weight: 700; margin: 22px 0 10px; }
.section-title:first-of-type { margin-top: 0; }

/* Bloco de exercício */
.ex { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; transition: opacity .15s; }
.ex.is-done { opacity: .5; }
.ex.is-done .ex-name { text-decoration: line-through; }
.ex-thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--card-2); border: 0; padding: 0; display: grid; place-items: center; color: var(--accent-dim); font-family: var(--font-head); font-size: 17px; line-height: 1; text-align: center; padding: 0 4px; text-transform: uppercase; position: relative; }
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-thumb .num { position: absolute; top: 4px; left: 4px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-body); font-size: 11px; font-weight: 800; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; }
.ex-main { min-width: 0; }
.ex-name { display: block; background: none; border: 0; padding: 0; color: var(--text); text-align: left; font-family: var(--font-head); font-size: 24px; line-height: 1.05; font-weight: 500; }
.ex-name:hover { color: var(--accent); }
.ex-sets { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.ex-sets.is-optional { color: var(--muted); }
.ex-note { color: var(--muted); font-size: 14px; margin-top: 4px; }
.ex-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.chk input { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--bg-2); display: grid; place-items: center; margin: 0; cursor: pointer; }
.chk input:checked { background: var(--accent); border-color: var(--accent); }
.chk input:checked::after { content: '✓'; color: var(--accent-ink); font-weight: 900; font-size: 14px; }
.load { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-left: auto; }
.load input { width: 64px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; text-align: right; }
.load input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.rest-card { text-align: center; padding: 40px 20px; }
.rest-card h2 { font-size: 40px; color: var(--accent); margin-bottom: 8px; }
.rest-card p { color: var(--muted); max-width: 48ch; margin: 0 auto; }

/* ---------- Progresso ---------- */
.charts { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .charts { grid-template-columns: 1fr 1fr; } }
.chart { min-height: 280px; }
.chart .ph { color: var(--muted); font-size: 14px; padding: 20px 0; }

/* ---------- Cronômetro ---------- */
.timer { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 30; max-width: calc(100vw - 24px); }
.timer-label { color: var(--muted); font-size: 13px; }
.timer-count { font-family: var(--font-head); font-size: 28px; color: var(--accent); min-width: 56px; text-align: center; line-height: 1; padding-top: 3px; }
.timer.is-running .timer-count { color: var(--text); }
.timer.is-over .timer-count { color: var(--ok); }
.timer-btn { white-space: nowrap; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.timer-btn:hover { border-color: var(--accent); }
.timer-stop { padding: 8px 11px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal { align-items: center; padding: 20px; } }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.modal-card { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0; }
@media (min-width: 640px) { .modal-card { border-radius: 20px; } }
.modal-close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); z-index: 2; }
.modal-body { padding: 18px 18px 24px; }
.modal-body .m-img { border-radius: 12px; overflow: hidden; background: #fff; margin-bottom: 14px; display: grid; place-items: center; min-height: 120px; }
.modal-body .m-img img { width: 100%; max-height: 320px; object-fit: contain; }
.modal-body .m-img.is-empty { background: var(--card-2); color: var(--accent-dim); font-family: var(--font-head); font-size: 28px; text-transform: uppercase; }
.modal-body .m-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 8px; }
.modal-body .m-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-body .m-video-title { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal-body .m-img { max-height: 220px; }
.modal-body .m-img img { max-height: 220px; }
.modal-body .m-group { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.modal-body h2 { font-size: 38px; margin: 2px 0 8px; }
.modal-body h2 a { color: var(--text); text-decoration: none; }
.modal-body h2 a:hover { color: var(--accent); }
.modal-body .m-today { display: grid; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.modal-body .m-today b { color: var(--accent); font-size: 18px; }
.modal-body .m-today span { color: var(--muted); font-size: 14px; }
.modal-body h4 { font-size: 22px; margin: 16px 0 6px; color: var(--accent); }
.modal-body p, .modal-body li { color: #d8d8d8; font-size: 15px; }
.modal-body ol { padding-left: 20px; }
.modal-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.modal-body th, .modal-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.modal-body th { color: var(--accent); }
body.modal-open { overflow: hidden; }

/* ---------- Rodapé ---------- */
.foot { display: flex; gap: 10px; color: var(--muted); font-size: 13px; padding: 30px 16px 10px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }
