:root {
  --bg: #0e0f12; --card: #17191e; --card2: #1f2229; --linha: #2a2e37; --txt: #f2f3f5; --muted: #9aa0ab;
  --acc: #c6ff3d; --acc-txt: #11140a; --amber: #ffb547; --red: #ff5d5d;
  --r: 16px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--txt); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: calc(88px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 1.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; margin: .2rem 0 .6rem; line-height: 1.1; }
h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: .4rem; }
.muted { color: var(--muted); font-size: .85rem; }
.centro { text-align: center; }
.grande { font-size: 3rem; font-weight: 900; line-height: 1.1; }

.topo { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
.titulo { font-weight: 900; font-size: 1.15rem; letter-spacing: .08em; color: var(--acc); }
.sub { font-size: .75rem; color: var(--muted); }
.nivel { text-align: right; line-height: 1.1; }
.nivel b { display: block; font-size: 1.1rem; }
.nivel span { font-size: .72rem; color: var(--muted); }
.xpbar { height: 4px; background: var(--card2); position: sticky; top: 58px; z-index: 5; }
.xpbar div { height: 100%; background: var(--acc); transition: width .5s; }

main { padding: 14px 14px 0; display: grid; gap: 10px; }
.card { background: var(--card); border-radius: var(--r); padding: 16px; }
.card.centro { display: grid; gap: 8px; justify-items: center; padding: 28px 16px; }
.campo { display: grid; gap: 4px; width: 100%; font-size: .85rem; color: var(--muted); text-align: left; }
.campo input { background: var(--card2); border: 1px solid var(--linha); border-radius: 10px; color: var(--txt); padding: 12px; font-size: 1rem; }
.btn { width: 100%; background: var(--acc); color: var(--acc-txt); border: 0; border-radius: 12px; padding: 14px; font-weight: 800; font-size: 1rem; margin-top: 6px; }
.btn.sec { background: var(--card2); color: var(--txt); }
.link { background: none; border: 0; color: var(--acc); text-align: left; padding: 4px 0; }
.erro { color: var(--red); font-size: .85rem; min-height: 1em; }

.missao { background: linear-gradient(160deg, #22262e, var(--card)); border-radius: var(--r); padding: 16px; border: 1px solid var(--linha); }
.missao.risca { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.prog { height: 10px; background: var(--card2); border-radius: 99px; overflow: hidden; width: 100%; }
.prog div { height: 100%; background: var(--acc); border-radius: 99px; transition: width .4s; }
.missao-rod { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 6px; font-weight: 700; }
.selo { margin-top: 10px; background: var(--acc); color: var(--acc-txt); font-weight: 900; text-align: center; padding: 8px; border-radius: 10px; letter-spacing: .05em; }

.item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 14px 16px; font-weight: 600; }
.item input { width: 24px; height: 24px; accent-color: var(--acc); flex: none; }
.item.ok { color: var(--muted); text-decoration: line-through; }

.ex { background: var(--card); border-radius: var(--r); padding: 14px; border-left: 4px solid transparent; }
.ex.feito { border-left-color: var(--acc); }
.ex-cab { display: flex; gap: 10px; align-items: flex-start; }
.ex-num { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: var(--muted); }
.ex-nome { font-weight: 800; }
.ex-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pills { display: flex; gap: 8px; }
.pill { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--linha); background: var(--card2); font-weight: 800; font-size: 1.05rem; transition: transform .1s; }
.pill:active { transform: scale(.92); }
.pill.ok { background: var(--acc); border-color: var(--acc); color: var(--acc-txt); }
.pill:disabled { opacity: .6; cursor: default; }
.kg { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.kg input { width: 72px; background: var(--card2); border: 1px solid var(--linha); border-radius: 10px; color: var(--txt); padding: 10px; font-size: 1rem; text-align: center; }
.kg.pr input { border-color: var(--acc); }
.pe { padding: 8px 0 16px; }

.timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); width: min(532px, calc(100% - 28px));
  background: var(--acc); color: var(--acc-txt); border-radius: var(--r); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 9;
  box-shadow: 0 10px 30px #0009; }
.timer.exec { background: var(--amber); }
.timer-rot { font-size: .8rem; font-weight: 700; }
.timer-num { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.timer button { background: #0002; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800; color: inherit; }

.abas { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: flex; background: #0e0f12f2;
  border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); z-index: 8; backdrop-filter: blur(8px); }
.abas button { flex: 1; background: none; border: 0; padding: 16px 0; font-weight: 700; color: var(--muted); }
.abas button.on { color: var(--acc); }

.toast { position: fixed; top: 80px; left: 50%; transform: translate(-50%, -20px); opacity: 0; background: var(--card2); border: 1px solid var(--acc);
  padding: 10px 18px; border-radius: 99px; font-weight: 800; transition: .25s; pointer-events: none; z-index: 20; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.grande { background: var(--acc); color: var(--acc-txt); font-size: 1.05rem; }

.legenda { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .78rem; color: var(--muted); }
.legenda .c { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.fase-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pct { font-size: 1.4rem; font-weight: 900; color: var(--acc); }
.fase-ok { border: 1px solid var(--acc); }
.semana { display: grid; grid-template-columns: 30px repeat(7, 1fr); gap: 5px; margin-top: 5px; align-items: center; }
.sem-rot { font-size: .72rem; color: var(--muted); font-weight: 700; }
.dia { aspect-ratio: 1; border-radius: 8px; border: 0; font-size: .75rem; font-weight: 800; background: var(--card2); color: var(--muted); }
.risca { background: var(--acc) !important; color: var(--acc-txt) !important; }
.parcial { background: var(--amber) !important; color: #2a1a00 !important; }
.perdido { background: var(--red) !important; color: #2a0000 !important; }
.desc { background: #14161a !important; color: #4a4f58 !important; }
.futuro { background: var(--card2); border: 1px solid var(--linha) !important; color: var(--txt) !important; }
.dia.hoje { outline: 2px solid var(--txt); outline-offset: 2px; }
.bloqueado { opacity: .55; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border-radius: var(--r); padding: 12px 8px; text-align: center; display: grid; gap: 2px; }
.stat b { font-size: 1.2rem; font-weight: 900; }
.stat span { font-size: .72rem; color: var(--muted); }
.conq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cq { background: var(--card2); border-radius: 12px; padding: 10px; display: grid; gap: 2px; opacity: .5; }
.cq.ok { opacity: 1; box-shadow: 0 0 0 1px var(--acc) inset; }
.cq-ico { font-size: 1.4rem; }
.rec { list-style: none; padding: 0; display: grid; gap: 6px; }
.rec li { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; border-bottom: 1px solid var(--linha); padding-bottom: 6px; }
.rec b { color: var(--acc); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.aviso { background: #3a2a00; border: 1px solid var(--amber); color: #ffe2a8; border-radius: var(--r); padding: 12px 14px; font-size: .9rem; }
.aviso-borda { border: 1px solid var(--amber); }
