:root {
  --roxo: #5A2D91; --roxo-esc: #3F1D68; --roxo-claro: #ECE4F6; --roxo-medio: #8E6CB8;
  --fundo: #F7F4FB; --papel: #FFFFFF; --tinta: #1D1529; --cinza: #6B6178; --linha: #E3DCEC;
  --ouro: #F2C14E;
  --verde: #2E9E5B; --amarelo: #E8B931; --laranja: #E8762D; --vermelho: #D23F3F; --bonus: #BDB5C7;
  --verde-fundo: #E3F2E8; --verde-tinta: #1E6B3D;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --corpo: 'DM Sans', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fundo); color: var(--tinta); font-family: var(--corpo); font-size: 15px; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ouro); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { min-height: 100%; display: flex; flex-direction: column; }
.tela { flex: 1; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 20px) max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.tela.sem-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.01em; text-wrap: balance; }
.sub { font-size: 13px; color: var(--cinza); }
.topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* entrada */
.entrada { background: var(--roxo); color: #fff; min-height: 100%; }
.entrada .tela { gap: 28px; padding-top: calc(env(safe-area-inset-top, 0px) + 56px); }
.entrada h1 { font-size: 52px; line-height: .95; letter-spacing: -.02em; }
.entrada .kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #D9C8F0; }
.entrada p { margin: 0; color: #E7DCF5; line-height: 1.45; }
.entrada label { font-weight: 700; display: block; margin-bottom: 8px; }
.entrada input { width: 100%; height: 56px; border-radius: 16px; border: 0; padding: 0 16px; font-size: 16px; background: #fff; color: var(--tinta); }
.entrada input.codigo { letter-spacing: .5em; font-size: 24px; font-weight: 700; text-align: center; }
.entrada .link { color: #fff; font-weight: 700; background: none; border: 0; padding: 0; text-decoration: underline; }
.btn-ouro { height: 58px; border-radius: 18px; border: 0; background: var(--ouro); color: var(--tinta); font-size: 17px; font-weight: 700; width: 100%; }
.btn-ouro:disabled, .btn:disabled { opacity: .5; }

/* cartões */
.cartao { background: var(--papel); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.linha-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.item-titulo { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.item-titulo .ico-t { color: var(--roxo); flex-shrink: 0; }
.op.bonus { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.item-info { font-size: 12px; color: var(--cinza); }
.par { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.op { height: 44px; border-radius: 12px; border: 1.5px solid var(--linha); background: var(--papel); font-size: 14px; font-weight: 500; }
.op[aria-pressed="true"] { background: var(--roxo); border-color: var(--roxo); color: #fff; font-weight: 700; }
.op.bonus[aria-pressed="true"] { background: var(--verde-fundo); border-color: var(--verde-fundo); color: var(--verde-tinta); }
.btn { height: 52px; border-radius: 16px; border: 0; background: var(--tinta); color: #fff; font-size: 16px; font-weight: 700; width: 100%; }
.btn.claro { background: var(--roxo-claro); color: var(--roxo); }
.btn.perigo { background: #FBEAE6; color: #B3361F; }
.btn-cam { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--roxo-claro); color: var(--roxo); font-size: 14px; font-weight: 700; }
.refeicoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ref { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ref-nome { font-size: 12px; font-weight: 700; }
.ref-foto { height: 84px; border-radius: 12px; overflow: hidden; position: relative; background: var(--roxo-claro); border: 0; padding: 0; }
.ref-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-foto .hora { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.85); border-radius: 6px; padding: 2px 6px; }
.ref-vazia { height: 84px; border-radius: 12px; border: 2px dashed #B9A5D6; background: transparent; color: var(--roxo); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; }
.ref-livre { height: 32px; border-radius: 10px; border: 1.5px solid var(--linha); background: var(--papel); font-size: 12px; }
.ref-livre[aria-pressed="true"] { background: #FDF3DC; border-color: #F0D58C; color: #7A5600; font-weight: 700; }
.ref-vazia.livre { border-color: #F0D58C; color: #7A5600; background: #FDF3DC; }
.pontos-hoje { text-align: right; }
.pontos-hoje b { font-family: var(--display); font-size: 26px; color: var(--roxo); display: block; }
.dia-sel { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.dia-sel button { flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--papel); font-size: 13px; }
.dia-sel button[aria-pressed="true"] { background: var(--tinta); color: #fff; font-weight: 700; }

/* navegação */
nav.abas { position: fixed; left: 0; right: 0; bottom: 0; background: var(--papel); border-top: 1px solid var(--linha); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); z-index: 5; }
nav.abas a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--cinza); text-decoration: none; font-size: 12px; font-weight: 500; padding: 4px 0; }
nav.abas a[aria-current="page"] { color: var(--roxo); font-weight: 700; }
.ico-aba { position: relative; display: inline-flex; }
.badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--vermelho); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.seg { background: var(--roxo-claro); border-radius: 14px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.seg button { height: 38px; border-radius: 11px; border: 0; background: transparent; color: var(--roxo); font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--papel); color: var(--tinta); font-weight: 700; }

/* câmera */
.camera { position: fixed; inset: 0; background: #0F0B16; color: #fff; z-index: 20; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 12px) max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(12px, env(safe-area-inset-left, 0px)); gap: 12px; }
.camera .cab { display: flex; justify-content: space-between; align-items: center; }
.camera .redondo { width: 48px; height: 48px; border-radius: 24px; border: 0; background: #2A2236; color: #fff; display: flex; align-items: center; justify-content: center; }
.camera .visor { flex: 1; border-radius: 24px; overflow: hidden; position: relative; background: #3A3346; }
.camera video, .camera .visor img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera .selo { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; align-items: center; background: rgba(15,11,22,.7); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.camera .selo i { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; }
.camera .dica { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(15,11,22,.7); border-radius: 14px; padding: 10px 14px; font-size: 13px; color: #E7DCF5; }
.camera .acoes { height: 110px; display: flex; align-items: center; justify-content: center; gap: 28px; }
.disparo { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.disparo span { width: 60px; height: 60px; border-radius: 50%; background: var(--ouro); }

/* feed */
.post { background: var(--papel); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.post-cab { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.post img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; display: block; background: var(--roxo-claro); }
.post-acoes { display: flex; align-items: center; gap: 10px; }
.fogo { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--linha); background: var(--papel); font-weight: 700; font-size: 13px; }
.fogo[aria-pressed="true"] { background: #FFF1E6; border-color: #F6C9A6; color: #B3561F; }
.coment { font-size: 13px; line-height: 1.4; }
.coment b { font-weight: 700; }
.coment-form { display: flex; gap: 6px; }
.coment-form input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1.5px solid var(--linha); padding: 0 10px; font-size: 14px; }
.coment-form button { height: 38px; border-radius: 10px; border: 0; background: var(--roxo); color: #fff; padding: 0 12px; font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; }
.chips button { height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--papel); font-size: 13px; flex: 0 0 auto; }
.chips button[aria-pressed="true"] { background: var(--tinta); color: #fff; font-weight: 700; }
.vazio { text-align: center; color: var(--cinza); padding: 32px 16px; line-height: 1.5; }

/* placar */
.grade-sem { display: grid; align-items: center; column-gap: 4px; }
.grade-sem > .h { font-size: 11px; color: var(--cinza); font-weight: 700; text-align: center; padding-bottom: 8px; border-bottom: 1.5px solid #EEE8F4; }
.grade-sem > .c { padding: 10px 0; border-bottom: 1px solid #F3EFF7; height: 100%; display: flex; align-items: center; }
.medalha { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: #EEE8F4; color: var(--cinza); }
.m1 { background: #D9B44A; color: #fff; } .m2 { background: #A9A6B3; color: #fff; } .m3 { background: #B9825A; color: #fff; }
.nome-cel { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: center; }
.mini .g { display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; }
.mini .g i { width: 9px; height: 9px; border-radius: 50%; }
.mini .g i.v { border: 1.5px dashed #D8C8C1; }
.mini em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--cinza); }
.mini em.dez { color: var(--verde-tinta); }
.pts-cel { justify-content: flex-end; font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--roxo); }
.legenda { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--cinza); }
.legenda span { display: flex; align-items: center; gap: 4px; }
.legenda i { width: 9px; height: 9px; border-radius: 50%; }
.chave { display: flex; align-items: center; gap: 12px; }
.chave .k { display: grid; grid-template-columns: repeat(3, 52px); row-gap: 6px; background: #F3EEF8; border-radius: 12px; padding: 8px 4px; }
.chave .k div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 700; color: var(--roxo); }
.pagas { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; }
.pagas div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--fundo); font-size: 12px; font-weight: 700; }
.pagas div b { font-size: 15px; color: var(--cinza); }
.pagas div.deve { background: #FBEAE6; } .pagas div.deve b { color: #B3361F; }
.escuro { background: var(--tinta); color: #fff; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.escuro .rotulo { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ouro); }
.premio { background: var(--roxo); color: #fff; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.premio .valor { font-family: var(--display); font-weight: 800; font-size: 30px; }
.barra { height: 8px; border-radius: 4px; background: #7A52A8; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--ouro); border-radius: 4px; }
.rank-linha { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #F3EFF7; }
.rank-linha .total { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--roxo); }
.seq { display: flex; align-items: center; gap: 10px; }
.seq .n { width: 86px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seq .b { flex: 1; height: 20px; border-radius: 6px; background: #F1ECF6; overflow: hidden; }
.seq .b i { display: block; height: 100%; background: var(--roxo); border-radius: 6px; }
.podios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.podio { background: var(--papel); border-radius: 18px; padding: 12px 10px 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.podio h3 { margin: 0; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.podio h3 .ico-t { color: var(--roxo); }
.podio .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-items: end; }
.podio .col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; font-size: 11px; }
.podio .col .avatar { width: 30px; height: 30px; font-size: 11px; }
.podio .col b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.podio .degrau { width: 100%; border-radius: 8px 8px 0 0; color: #fff; display: flex; justify-content: center; padding-top: 4px; font-size: 13px; font-weight: 800; }

/* aceite / perfil */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--roxo); flex-shrink: 0; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 700; }
.campo input, .campo select { height: 46px; border-radius: 12px; border: 1.5px solid var(--linha); padding: 0 12px; background: var(--papel); font-size: 15px; }
a { color: var(--roxo); }

#aviso { position: fixed; left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); background: var(--tinta); color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; z-index: 30; text-align: center; max-width: 520px; margin: 0 auto; }

@media (prefers-reduced-motion: no-preference) { .op, .seg button, .fogo { transition: background .15s, color .15s; } }
