/* Amigo Secreto — ferramenta do coisaútil.tech.
   Cores, fonte, header e footer vêm de /assets/ui.css (carregado antes). Visual shadcn. */
:root {
  --ok: #16a34a;
  --ok-fundo: color-mix(in srgb, #16a34a 12%, transparent);
  --perigo-fundo: color-mix(in srgb, var(--destructive) 10%, transparent);
  --zap: #1fa855;
  --fundo-festa: #f7f4eb;   /* creme, só no Amigo Secreto */
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #22c55e; --fundo-festa: #15120a; } }
:root[data-theme="dark"] { --ok: #22c55e; --fundo-festa: #15120a; }

/* Fundo levemente amarelado (os cartões e campos continuam brancos) */
body { background: var(--fundo-festa); }
.site-header { background: color-mix(in srgb, var(--fundo-festa) 85%, transparent); }

[hidden] { display: none !important; }
body { display: flex; flex-direction: column; }

/* ---------- Topo do site ---------- */
.ic1 { fill: #fe0030; }
.ic2, .ic3, .ic4, .ic5 { stroke: #161616; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4.36px; }
.ic2 { fill: #c4c4c4; } .ic3 { fill: none; } .ic4 { fill: #e7e7e6; } .ic5 { fill: #ff7d7d; } .ic6 { fill: #161616; }
.voltar-site { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--radius);
  color: var(--muted-foreground); font-size: .875rem; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.voltar-site:hover { background: var(--accent); color: var(--accent-foreground); }

/* ---------- Estrutura ---------- */
.app { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 36px 16px 56px; }
.app.largo { max-width: 640px; }
.cabecalho { text-align: center; margin-bottom: 24px; }
.kicker { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 9999px;
  padding: 2px 12px 2px 8px; font-size: .75rem; font-weight: 500; margin-bottom: 14px; background: var(--background); }
.kicker:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.cabecalho h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; overflow-wrap: anywhere; }
.subtopo { margin-top: 8px; color: var(--muted-foreground); font-size: .9375rem; }

.cartao { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); padding: 24px 20px 20px; box-shadow: var(--shadow-sm); }
@media (min-width: 480px) { .cartao { padding: 24px; } }
.cartao + .cartao, .cartao + .numeros, .numeros + .cartao, .numeros + .numeros { margin-top: 16px; }
.cartao h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; margin-bottom: 4px; }
.cartao h3 { font-weight: 600; }
.cartao p { line-height: 1.5; }
.sub, .dica { color: var(--muted-foreground); margin: 0 0 18px; font-size: .875rem; line-height: 1.5; }
.dica { margin-top: 14px; text-align: center; }
.ola { margin-bottom: 14px; color: var(--muted-foreground); font-size: .9375rem; }
.ola strong { color: var(--foreground); font-weight: 600; }
.separador { border: 0; height: 1px; background: var(--border); margin: 22px 0 16px; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 500; font-size: .875rem; }
label small { font-weight: 400; color: var(--muted-foreground); font-size: .8125rem; }
label > small { margin-top: -4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=search], input[type=url], textarea, select {
  display: block; width: 100%; min-width: 0; max-width: 100%;
  height: 42px; padding: 0 12px;
  font-size: 16px; /* evita zoom no iPhone */
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; font-family: inherit; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}
input[type=date] { -webkit-appearance: none; appearance: none; line-height: 40px; }
select {
  padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.dois { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dois > label { min-width: 0; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.marcar { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .875rem; color: var(--muted-foreground); line-height: 1.4; }
.marcar input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: none; }

/* ---------- Botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 44px; padding: 0 16px; text-align: center;
  font-size: .9375rem; font-weight: 500; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm);
  transition: background-color .15s, color .15s, border-color .15s, transform .05s;
}
.botao:hover { background: var(--primary-hover); }
.botao:active { transform: translateY(1px); }
.botao.secundario { background: var(--background); color: var(--foreground); border-color: var(--input); margin-top: 8px; }
.botao.secundario:hover { background: var(--accent); }
.botao.perigo { background: var(--destructive); color: var(--destructive-foreground); }
.botao.perigo:hover { background: color-mix(in srgb, var(--destructive) 88%, #000); }
.botao.zap { background: var(--zap); color: #fff; }
.botao.zap:hover { background: color-mix(in srgb, var(--zap) 88%, #000); }
.botao.grande { height: 52px; font-size: 1.0625rem; }
.botao[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.link {
  display: block; margin: 14px auto 0; padding: 8px; background: none; border: 0; cursor: pointer;
  color: var(--muted-foreground); font-size: .875rem; text-decoration: underline; text-underline-offset: 4px; text-align: center;
}
.link:hover { color: var(--foreground); }
.link.claro { color: var(--muted-foreground); }
.mini {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 10px;
  font-size: .8125rem; font-weight: 500; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input); background: var(--background); color: var(--foreground); cursor: pointer; box-shadow: var(--shadow-sm);
}
.mini:hover { background: var(--accent); }
.mini.forte { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); height: auto; padding: 0 14px; }
.mini.forte:hover { background: var(--primary-hover); }
.dois-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dois-botoes .botao { margin-top: 0; }
.sair-painel { margin-top: 8px; }

/* ---------- Avisos ---------- */
.aviso {
  border: 1px solid color-mix(in srgb, var(--destructive) 45%, transparent); background: var(--perigo-fundo);
  color: var(--destructive); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: .875rem; font-weight: 500;
}
.aviso.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-fundo); color: var(--ok); }
.aviso-afiliado { font-size: .8125rem; line-height: 1.45; color: var(--muted-foreground); background: var(--muted); border-radius: var(--radius); padding: 8px 12px; margin: -4px 0 10px; }

/* ---------- Página inicial ---------- */
.abas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--muted); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; }
.abas button { border: 0; background: none; height: 34px; border-radius: calc(var(--radius) - 2px); font-weight: 500; font-size: .875rem; color: var(--muted-foreground); cursor: pointer; transition: background .15s, color .15s; }
.abas button[aria-selected="true"] { background: var(--background); color: var(--foreground); box-shadow: var(--shadow); }
.linha-form { grid-template-columns: 1fr auto; align-items: stretch; }
.linha-form .botao { width: auto; height: auto; padding: 0 20px; }
.numero { text-align: center; font-size: 22px !important; letter-spacing: 4px; font-weight: 600; font-variant-numeric: tabular-nums; height: 48px !important; }
.numero::placeholder { font-size: 15px; letter-spacing: 0; font-weight: 400; }

/* ---------- Participante: escolher nome ---------- */
.busca { position: relative; }
.sugestoes {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  list-style: none; padding: 4px; background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 24px rgb(0 0 0 / .12);
  max-height: 264px; overflow-y: auto;
}
.sugestoes.aberta { display: block; }
.sugestoes li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 10px; border-radius: calc(var(--radius) - 2px); cursor: pointer; font-size: 1rem; }
.sugestoes li:hover, .sugestoes li:active { background: var(--accent); }
.sugestoes em { font-style: normal; font-size: .75rem; color: var(--ok); white-space: nowrap; }
.sugestoes em.novo { color: var(--primary); }
.sugestoes li.vazio { color: var(--muted-foreground); cursor: default; }
.sugestoes li.vazio:hover { background: none; }

/* ---------- Espera e revelação ---------- */
.espera { text-align: center; }
.relogio { font-size: 44px; margin-bottom: 8px; }
.espera p { color: var(--muted-foreground); line-height: 1.55; }
.contagem { font-weight: 600; color: var(--primary) !important; margin-top: 6px; }
.raspadinha {
  position: relative; display: block; width: 100%; height: 150px; margin: 16px 0 4px; padding: 0;
  border: 1px dashed var(--input); border-radius: calc(var(--radius) + 4px);
  background: var(--background); cursor: pointer; overflow: hidden; font: inherit; color: inherit;
}
.raspadinha .capa {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 6px;
  background: repeating-linear-gradient(45deg, var(--primary) 0 16px, color-mix(in srgb, var(--primary) 85%, #000) 16px 32px);
  color: #fff; font-size: 40px; line-height: 1.1; transition: transform .5s ease, opacity .5s;
}
.raspadinha .capa small { font-size: .875rem; font-weight: 600; }
.raspadinha .nome-sorteado {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 10px;
  font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; color: var(--foreground);
  opacity: 0; transition: opacity .3s .2s;
}
.raspadinha.aberta .capa { transform: translateY(-100%); opacity: 0; }
.raspadinha.aberta .nome-sorteado { opacity: 1; }

/* ---------- Formulário de dicas ---------- */
.escolhas { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.escolhas legend { font-weight: 600; font-size: .9375rem; padding: 0; display: flex; justify-content: space-between; width: 100%; gap: 8px; }
.escolhas .sub { margin: 4px 0 10px; }
#contador { font-size: .75rem; font-weight: 500; background: var(--secondary); color: var(--secondary-foreground); padding: 2px 10px; border-radius: 9999px; white-space: nowrap; align-self: center; }
#contador.cheio { background: var(--primary); color: var(--primary-foreground); }
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opcao {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 26px 10px 10px;
  font-weight: 500; font-size: .8125rem; line-height: 1.25;
  border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); cursor: pointer;
  transition: border-color .15s, background .15s, opacity .15s;
}
.opcao:hover { background: var(--accent); }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao .icone { font-size: 22px; }
.opcao:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--background)); box-shadow: inset 0 0 0 1px var(--primary); }
.opcao:has(input:checked)::after {
  content: '✓'; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.opcao:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.opcao.desligada { opacity: .4; cursor: not-allowed; }
.opcao.larga { grid-column: 1 / -1; }

/* ---------- Dicas de quem você tirou ---------- */
.dicas { margin-top: 16px; padding: 16px; border-radius: var(--radius); background: var(--background); border: 1px solid var(--border); }
.dicas h3 { font-size: 1rem; margin-bottom: 4px; }
.dicas.vazio p { color: var(--muted-foreground); line-height: 1.5; font-size: .875rem; }
.limite { margin-bottom: 12px; color: var(--muted-foreground); font-size: .875rem; }
.limite strong { color: var(--foreground); white-space: nowrap; }
.sub strong { white-space: nowrap; color: var(--foreground); font-weight: 600; }
.medidas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.medidas div { background: var(--muted); border-radius: var(--radius); padding: 8px; text-align: center; }
.medidas span { display: block; font-size: .75rem; color: var(--muted-foreground); }
.medidas strong { font-size: 1.25rem; font-weight: 600; }
.linha { margin-bottom: 10px; font-size: .9375rem; }
.linha span, .linha .rotulo { display: block; font-size: .75rem; font-weight: 500; color: var(--muted-foreground); margin-bottom: 2px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--secondary); color: var(--secondary-foreground); border-radius: 9999px; padding: 4px 12px; font-size: .8125rem; font-weight: 500; }

/* Links de produtos */
.campo-link + .campo-link { margin-top: 10px; }
.previa:empty { display: none; }
.previa { margin-top: 6px; }
.carregando { font-size: .8125rem; color: var(--muted-foreground); padding: 6px 2px; }
.carregando.erro { color: var(--destructive); }
.produtos { display: grid; gap: 8px; margin-top: 4px; }
.produto { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: inherit; transition: border-color .15s; }
a.produto:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.produto .foto { width: 56px; height: 56px; border-radius: calc(var(--radius) - 2px); background: var(--muted); display: grid; place-items: center; overflow: hidden; }
.produto .foto img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.produto .foto b { display: none; font-size: 26px; }
.produto.sem-foto .foto b { display: block; }
.produto .info { min-width: 0; }
.produto strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .875rem; font-weight: 500; line-height: 1.3; }
.produto small { color: var(--primary); font-size: .75rem; font-weight: 500; }
.links-titulo { margin-top: 12px; }

/* ---------- Selos (badges) ---------- */
.selo { display: inline-flex; align-items: center; font-size: .6875rem; font-weight: 500; padding: 1px 8px; border-radius: 9999px; white-space: nowrap; line-height: 1.6; }
.selo.sim { background: var(--ok-fundo); color: var(--ok); }
.selo.nao { background: var(--secondary); color: var(--muted-foreground); }
.selo.perigo { background: var(--perigo-fundo); color: var(--destructive); }
.status { text-align: center; padding: 14px; border-radius: var(--radius); background: var(--muted); margin-bottom: 16px; font-size: .875rem; color: var(--muted-foreground); }
.status strong { display: block; font-size: 1rem; font-weight: 600; color: var(--foreground); margin-bottom: 2px; }
.tabela { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: .875rem; }
.tabela td { padding: 10px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabela td:last-child { text-align: right; }

/* ---------- Painel do organizador ---------- */
.numero-grupo { text-align: center; background: var(--muted); border-radius: var(--radius); padding: 12px; margin: 8px 0 12px; }
.numero-grupo span { display: block; font-size: .75rem; color: var(--muted-foreground); font-weight: 500; }
.numero-grupo strong { font-size: 2rem; font-weight: 700; letter-spacing: 4px; color: var(--primary); font-variant-numeric: tabular-nums; }
.caixa-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.caixa-link input { font-size: 14px !important; color: var(--muted-foreground) !important; }
.interruptor { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.interruptor strong { display: block; font-size: .875rem; font-weight: 500; }
.interruptor span { font-size: .8125rem; color: var(--muted-foreground); line-height: 1.4; }
.chave { flex: none; width: 44px; height: 24px; border-radius: 9999px; border: 0; background: var(--input); position: relative; cursor: pointer; transition: background .2s; }
.chave span { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .2s; }
.chave.ligada { background: var(--primary); }
.chave.ligada span { transform: translateX(20px); }
.contador-titulo { font-size: .75rem; font-weight: 500; background: var(--secondary); color: var(--secondary-foreground); border-radius: 9999px; padding: 2px 10px; vertical-align: middle; }
.adicionar { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.pessoas { list-style: none; margin-top: 8px; }
.pessoas li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nome menu" "selos menu"; gap: 4px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pessoas li:last-child { border-bottom: 0; }
.pessoa-nome { grid-area: nome; font-weight: 500; font-size: .9375rem; overflow-wrap: anywhere; }
.pessoa-nome small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted-foreground); }
.selos { grid-area: selos; display: flex; flex-wrap: wrap; gap: 4px; }
details.menu { grid-area: menu; position: relative; }
details.menu summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; font-size: 20px; color: var(--muted-foreground); }
details.menu summary:hover { background: var(--accent); }
details.menu summary::-webkit-details-marker { display: none; }
details.menu[open] summary { background: var(--accent); }
details.menu > div { position: absolute; right: 0; top: 40px; z-index: 6; min-width: 210px; padding: 4px;
  background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 24px rgb(0 0 0 / .12); }
details.menu form { margin: 0; }
details.menu button, details.menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: calc(var(--radius) - 2px); font-size: .875rem; cursor: pointer; color: inherit; }
details.menu button:hover, details.menu a:hover { background: var(--accent); }
.perigo-texto { color: var(--destructive) !important; }
.contas li.banida .pessoa-nome { color: var(--muted-foreground); text-decoration: line-through; }

.sanfona summary { cursor: pointer; font-weight: 500; font-size: .9375rem; padding: 6px 0; list-style: none; }
.sanfona summary::-webkit-details-marker { display: none; }
.sanfona summary::before { content: '›'; display: inline-block; width: 14px; color: var(--muted-foreground); transition: transform .15s; }
.sanfona[open] summary::before { transform: rotate(90deg); }
.sanfona[open] summary { margin-bottom: 10px; }
.sanfona + .sanfona { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sanfona.perigo summary { color: var(--destructive); }
.sanfona.novo { margin-top: 14px; border: 1px dashed var(--input); border-radius: var(--radius); padding: 10px 14px; }
.sanfona.novo summary { color: var(--primary); }

.grupos { list-style: none; margin-top: 8px; display: grid; gap: 8px; }
.grupos a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); transition: border-color .15s, box-shadow .15s; }
.grupos a:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); }
.grupos strong { display: block; font-size: .9375rem; font-weight: 600; }
.grupos span:not(.selo) { font-size: .8125rem; color: var(--muted-foreground); }
.voltar { display: inline-flex; color: var(--muted-foreground); font-size: .875rem; font-weight: 500; margin: 0 0 12px 2px; }
.voltar:hover { color: var(--foreground); }

/* ---------- Administração ---------- */
.abas-admin { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; margin: 0 auto 16px; width: fit-content; max-width: 100%; background: var(--muted); border-radius: var(--radius); }
.abas-admin a { flex: none; font-weight: 500; font-size: .875rem; padding: 6px 12px; border-radius: calc(var(--radius) - 2px); color: var(--muted-foreground); }
.abas-admin a[aria-current] { background: var(--background); color: var(--foreground); box-shadow: var(--shadow); }
.numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.numero-card { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.numero-card span { display: block; font-size: .8125rem; color: var(--muted-foreground); font-weight: 500; }
.numero-card strong { display: block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.numero-card small { font-size: .75rem; color: var(--ok); font-weight: 500; }
.lista-simples { list-style: none; margin-top: 6px; }
.lista-simples li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.lista-simples li:last-child { border-bottom: 0; }
.lista-simples strong { display: block; font-weight: 500; }
.lista-simples span { font-size: .8125rem; color: var(--muted-foreground); overflow-wrap: anywhere; }
.busca-admin { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 6px 0 10px; }
.exportar { margin-bottom: 6px; }
.exportar .link { margin-top: 4px; }
.grafico { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.barra { position: relative; flex: 1; height: max(var(--h), 2px); background: var(--primary); opacity: .85; border-radius: 3px 3px 0 0; outline: none; }
.barra span { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--foreground); color: var(--background); font-size: .75rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.barra:hover span, .barra:focus span { display: block; }
.barra:hover, .barra:focus { opacity: 1; }
.eixo { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted-foreground); margin-top: 6px; }

/* ---------- Comemoração (emojis) ---------- */
.festa { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.festa span { position: absolute; line-height: 1; will-change: transform, opacity; }

/* ---------- Paleta de cores (formulário de dicas) ---------- */
.campo-cores { display: grid; gap: 8px; }
.rotulo-campo { font-weight: 500; font-size: .875rem; }
.rotulo-campo small { font-weight: 400; color: var(--muted-foreground); font-size: .8125rem; }
.amostra { display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--foreground) 18%, transparent); }
.paleta { position: relative; }
.paleta summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 40px; padding: 6px 12px; border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--background); box-shadow: var(--shadow-sm); font-size: .9375rem; font-weight: 400;
}
.paleta summary::-webkit-details-marker { display: none; }
.paleta[open] summary, .paleta summary:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
.paleta.invalida summary { border-color: var(--destructive); }
.paleta-escolhidas { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.paleta-vazia { color: var(--muted-foreground); }
.chip-cor { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; border-radius: 9999px; background: var(--muted); font-size: .8125rem; font-weight: 500; }
.paleta-seta { width: 8px; height: 8px; flex: none; border-right: 2px solid var(--muted-foreground); border-bottom: 2px solid var(--muted-foreground); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.paleta[open] .paleta-seta { transform: rotate(-135deg) translateY(-2px); }
.paleta-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  padding: 12px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: var(--popover); color: var(--popover-foreground); box-shadow: 0 10px 30px -10px rgb(0 0 0 / .3);
}
.paleta-dica { font-size: .8125rem; color: var(--muted-foreground); margin-bottom: 10px; }
.paleta-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.cor-opcao { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; font-weight: 400; text-align: center; position: relative; }
.cor-opcao:hover { background: var(--accent); }
.cor-opcao input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cor-opcao .amostra { width: 30px; height: 30px; }
.cor-nome { font-size: .75rem; line-height: 1.2; color: var(--muted-foreground); }
.cor-opcao:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.cor-opcao:has(input:checked) .cor-nome { color: var(--foreground); font-weight: 500; }
.cor-opcao:has(input:checked) .amostra { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary); }
.cor-opcao:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 1px; }
.cor-opcao.desligada { opacity: .4; cursor: not-allowed; }
.paleta-ok { margin-top: 10px; width: 100%; height: 36px; border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--background); font-weight: 500; font-size: .875rem; cursor: pointer; }
.paleta-ok:hover { background: var(--accent); }
.cores-escolhidas li { display: inline-flex; align-items: center; gap: 6px; }
.cores-escolhidas .amostra { width: 14px; height: 14px; }
