@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }

/* Marca Trem que Sorteia: verde de maria-fumaça, mostarda e vermelho só nos alertas. */
:root {
  --bg: #f4f1e6;
  --surface: #fffdf7;
  --text: #17251f;
  --muted: #5c6a62;
  --border: #dcd6c4;
  --accent: #1d5a42;
  --accent-text: #ffffff;
  --accent-soft: #e2efe7;
  --mustard: #f0c457;
  --danger: #b0223f;
  --danger-soft: #fbe3e8;
  --ok: #166534;
  --ok-soft: #e3f4ea;
  --wa: #15803d;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --warn-border: #f2c66d;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.top { background: var(--accent); position: relative; margin-bottom: 12px; }
/* Trilho embaixo do cabeçalho: dois trilhos e os dormentes. */
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background:
    linear-gradient(#8a8f86, #8a8f86) 0 1px / 100% 2px no-repeat,
    linear-gradient(#8a8f86, #8a8f86) 0 7px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #6b4a2f 0 6px, transparent 6px 18px);
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 10px 16px; color: #ffffff; text-decoration: none; }
.brand-mark svg { width: 52px; height: 52px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-name .que { color: var(--mustard); }
.brand-tag { font-size: 0.8125rem; font-weight: 500; margin-top: 5px; }
@media (max-width: 420px) { .brand-name { font-size: 1.375rem; } .brand-tag { font-size: 0.75rem; } .brand-mark svg { width: 46px; height: 46px; } }
.wrap { max-width: 760px; margin: 0 auto; padding: 40px 16px 80px; }

h1, h2, .reveal .name { font-family: "Bricolage Grotesque", system-ui, sans-serif; }
h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 8px; color: #0f3a2a; }
h2 { font-size: 1.1875rem; font-weight: 700; margin: 28px 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-width: 1.5px;
  box-shadow: 0 2px 0 var(--border);
  padding: 16px;
  margin-bottom: 12px;
}

label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=tel] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 200px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  font: inherit; font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 0 #0f3a2a; }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #0f3a2a; }
.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.ghost { background: transparent; }
.danger { color: var(--danger); }
.big { padding: 14px 22px; font-size: 1.0625rem; width: 100%; }

.person-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.person-name { font-weight: 700; font-size: 1.0625rem; }
.person-phone { color: var(--muted); font-size: 0.875rem; }
.icon-btn { padding: 6px 10px; font-size: 0.875rem; }

details.rules { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.rules summary { cursor: pointer; font-size: 0.875rem; color: var(--muted); }
.rule-group { margin-top: 12px; }
.rule-group .label { font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; font-size: 0.875rem; font-weight: 500;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
}
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

.notice { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: 0.9375rem; }
.notice.warn { background: #fbf0d2; color: var(--text); border: 1.5px solid #e3b54a; border-left: 6px solid var(--mustard); }
.notice.info { background: var(--surface); border: 1px dashed var(--border); }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox input { font-size: 0.8125rem; }

.result-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.reveal { text-align: center; padding: 28px 16px 22px; overflow-x: clip; }
.reveal .gift { font-size: 4rem; line-height: 1; margin-bottom: 12px; }
.reveal .gift svg { width: 96px; height: 96px; display: inline-block; }
.reveal .name { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 20px; color: var(--accent); word-break: break-word;
  text-decoration: underline 6px var(--mustard); text-underline-offset: 8px; }

.toast {
  position: fixed; left: 50%; top: 16px; z-index: 50;
  transform: translateX(-50%) translateY(-12px);
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 8px 8px 8px 16px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 27, 22, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; font-size: 0.9375rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.error { background: #7f1d12; color: #fff; }
.toast-msg { flex: 1; }
.toast-close {
  flex: none; width: 28px; height: 28px; padding: 0;
  background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.35); border-radius: 6px;
  font-size: 0.875rem; font-weight: 600;
}
.toast-close:hover { background: rgba(255,255,255,.15); }
.toast-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.save-state { font-size: 0.8125rem; color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }

@media (max-width: 520px) {
  .result-row { align-items: stretch; }
  .result-actions { width: 100%; }
  .result-actions > * { flex: 1; }
}

.import-actions { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.import-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.import-hint strong { color: var(--text); font-weight: 600; }
.import-hint-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
}
@media (max-width: 520px) {
  .import-hint { border-radius: 12px; }
}
.small-btn { padding: 6px 12px; font-size: 0.875rem; font-weight: 500; }
#paste-panel { margin-top: 12px; }
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}
[hidden] { display: none !important; }

.date-field { flex: 0 1 190px; min-width: 160px; }
input[type=date] {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hint { font-size: 0.875rem; margin: 0 0 6px; }
.warn-text { color: var(--danger); }
.notice.small { font-size: 0.875rem; }
.card .notice { margin: 0 0 12px; }

/* Texto e botão na mesma linha; no celular o botão desce para baixo do texto. */
.inline-action { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.inline-action > p { flex: 1 1 280px; margin: 0; }
.inline-action > button { flex: 0 0 auto; }

/* Título de seção que abre/fecha (ex.: "Excluir sorteio") */
details.collapsible { margin: 28px 0 12px; }
details.collapsible > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform .15s;
}
details.collapsible[open] > summary::before { transform: rotate(90deg); }

/* Restrições: campo com etiquetas das pessoas marcadas + busca + lista */
.combo { position: relative; }
.combo-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: text;
}
.combo-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-box .combo-input { /* mais específico que input[type=text] */
  flex: 1 1 120px;
  width: auto;
  min-width: 100px;
  padding: 4px 4px;
  font: inherit; font-size: 0.9375rem;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.combo-input:focus-visible { outline: none; }
.chip.on {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 4px 2px 10px;
  font-size: 0.875rem;
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.chip-x {
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: inherit;
  font-size: 1rem; line-height: 1; font-weight: 500;
}
.chip-x:hover { background: rgba(192, 57, 43, .12); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 240px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 27, 22, .12);
}
.combo-option { padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 0.9375rem; }
.combo-option.active, .combo-option:hover { background: var(--accent-soft); color: var(--accent); }
.combo-empty { padding: 9px 10px; color: var(--muted); font-size: 0.875rem; }

/* Editar/Remover lado a lado também no celular */
.person-head .row { flex-wrap: nowrap; gap: 6px; flex: none; }

/* Aviso em destaque (ex.: regra do círculo único) */
.callout-warn {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn);
  border-radius: 10px;
  color: var(--warn);
}
.callout-warn strong { display: block; font-size: 0.9375rem; margin-bottom: 2px; }
.callout-warn p { margin: 0; font-size: 0.875rem; color: #5f4310; }
.callout-icon { font-size: 1.125rem; line-height: 1.3; flex: none; }

/* Explicação em destaque (informativa, não é erro) */
.callout-info {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #eef4fb;
  border: 1px solid #c4d7ee;
  border-left: 4px solid #2f6db3;
  border-radius: 10px;
  color: #1f4f86;
}
.callout-info strong { display: block; font-size: 0.9375rem; margin-bottom: 2px; }
.callout-info p { margin: 0; font-size: 0.875rem; color: #2a3f57; }
.callout-info .callout-note { margin-top: 6px; color: #1e7e4a; font-weight: 600; }

/* ---------- Lista compacta de participantes ---------- */
.people-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
.people-search {
  flex: 1 1 240px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0; font-weight: 400;
}
.people-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.people-search input[type=search] {
  flex: 1; min-width: 0;
  padding: 10px 0;
  font: inherit; font-size: 0.9375rem;
  color: var(--text);
  background: transparent;
  border: 0; outline: none;
}
.chip.filter { padding: 8px 12px; background: var(--surface); }
.chip.filter[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.people {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.person { border-bottom: 1px solid var(--border); }
.person:last-of-type { border-bottom: 0; }
.person.open { background: #fdfbf8; }
.person-row { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; }
.person-toggle {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  background: transparent; border: 0; border-radius: 8px;
  font-weight: 400; text-align: left; justify-content: flex-start;
}
.person-toggle:hover { background: var(--bg); }
.person-toggle .chev { color: var(--muted); transition: transform .15s; flex: none; }
.person.open .chev { transform: rotate(90deg); }
.person-toggle .person-name { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-toggle .person-phone { font-size: 0.875rem; white-space: nowrap; }
.person-toggle .badge { margin-left: 0; flex: none; }
.person-actions { display: flex; gap: 2px; flex: none; }
.person-actions .icon-btn { padding: 6px 8px; border-color: transparent; background: transparent; }
.person-actions .icon-btn:hover { background: var(--bg); border-color: var(--border); }
.person-rules { padding: 0 16px 16px 40px; }
.person-rules .rule-group:first-child { margin-top: 0; }
.person.editing { padding: 14px 16px; background: #fdfbf8; }
.people-empty { padding: 14px 16px; margin: 0; }

@media (max-width: 520px) {
  .person-toggle { flex-wrap: wrap; row-gap: 0; }
  .person-toggle .badge { order: 2; }
  .person-toggle .person-phone { order: 3; flex-basis: 100%; padding-left: 22px; }
  .person-rules { padding: 0 12px 14px; }
}

/* ---------- Barra fixa do sorteio ---------- */
.draw-bar {
  position: sticky; bottom: 12px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 24px;
  padding: 10px 10px 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(31, 27, 22, .14);
}
.draw-bar-info { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; font-size: 0.9375rem; }
.draw-bar-info span { color: var(--muted); }
.draw-bar-info .draw-bar-hint { color: var(--danger); font-size: 0.8125rem; font-weight: 600; flex-basis: 100%; }
.draw-bar .primary { padding: 12px 20px; }
@media (max-width: 520px) {
  .draw-bar { bottom: 8px; }
  .draw-bar .primary { flex: 1; }
}

/* ---------- Janela de confirmação ---------- */
.dialog {
  width: min(520px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(31, 27, 22, .25);
}
.dialog::backdrop { background: rgba(15, 42, 32, .5); }
.dialog h2 { margin: 0 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-input { margin: 4px 0 16px; font-size: 0.875rem; }
.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 4px 0 #7a1529; }
.danger-solid:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a1529; }

/* Alerta na barra do sorteio quando as restrições impedem o círculo */
.draw-bar-warn {
  flex-basis: 100%;
  order: -1;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn);
  border-radius: 10px;
  color: #5f4310;
  font-size: 0.875rem;
}
.draw-bar-warn strong { color: var(--warn); }
.link-btn {
  padding: 0; border: 0; background: none;
  color: var(--warn); font-weight: 700; font-size: 0.875rem;
  text-decoration: underline; text-underline-offset: 2px;
}
.badge.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.draw-bar-warn > span:nth-child(2) { flex: 1 1 220px; }

/* ---------- Telefone repetido (aviso no lugar, acima dos botões) ---------- */
.phone-warn {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn);
  border-radius: 10px;
  color: #5f4310;
  font-size: 0.875rem;
}
.phone-warn > strong { display: block; color: var(--warn); font-size: 0.9375rem; margin-bottom: 2px; }
.phone-warn p { margin: 2px 0 0; }

/* ---------- Depois do sorteio ---------- */
.progress-line { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); }
.progress { height: 6px; margin: 6px 0 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.sent-row .person-row { padding: 8px 10px 8px 16px; }
.sent-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.sent-info .person-name { font-weight: 600; }
.sent-info .badge { margin-left: 0; }
.sent-info .person-phone { font-size: 0.875rem; }
.sent-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.btn.wa.small-btn { padding: 7px 12px; font-weight: 600; }
.btn.wa.was-sent { background: var(--surface); color: var(--ok); border-color: var(--ok); }
@media (max-width: 520px) {
  .sent-row .person-row { align-items: flex-start; padding: 10px 8px 10px 12px; }
  .sent-info .person-phone { flex-basis: 100%; }
}
@media (max-width: 520px) { .hide-sm { display: none; } }

/* Restrições só para consulta (depois do sorteio) */
.sent-toggle {
  padding: 6px 8px; margin: -6px 0 -6px -8px;
  background: transparent; border: 0; border-radius: 8px;
  font-weight: 400; text-align: left; justify-content: flex-start;
}
.sent-toggle:hover { background: var(--bg); }
.sent-row .chev { color: var(--muted); transition: transform .15s; }
.sent-row.open .chev { transform: rotate(90deg); }
.chip.readonly { padding: 3px 10px; cursor: default; }
.readonly-rules { padding: 0 16px 14px 34px; }
.readonly-rules .rule-group { margin-top: 8px; }
.readonly-rules p { margin: 10px 0 0; }
@media (max-width: 520px) { .readonly-rules { padding: 0 12px 12px; } }

/* ---------- Lista de presentes ---------- */
.wish-list { list-style: none; margin: 0 0 12px; padding: 0; }
.wish-list li {
  display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.wish-list li:last-child { border-bottom: 0; }
.wish-text { flex: 1 1 200px; }
/* No resultado, cada sugestão vira um cartãozinho com o botão da Amazon do lado. */
.reveal-wishes .wish-list li { background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; }
.reveal-wishes .wish-list li:last-child { border-bottom: 1.5px solid var(--border); }
.reveal-wishes .wish-text { font-weight: 600; flex: 1 1 140px; }
@media (max-width: 520px) { .reveal-wishes .wish-list .amazon-btn { flex: 1 1 100%; } }

.wish-link { font-size: 0.875rem; color: #2f6db3; white-space: nowrap; }
.affiliate-note { margin: 14px 0 0; font-size: 0.75rem; }

/* Botão da Amazon: no estilo dos botões da marca (mostarda, contorno escuro e "degrau" embaixo). */
.amazon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius); white-space: nowrap;
  background: var(--mustard); color: #17251f; border: 2px solid #0f2a20; box-shadow: 0 3px 0 #0f2a20;
  font-weight: 700; font-size: 0.875rem; line-height: 1.2; text-decoration: none;
}
.amazon-btn:hover { background: #f5cf6d; }
.amazon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0f2a20; }
.amazon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.amazon-ico { width: 15px; height: 15px; flex: none; }
.amazon-btn-wide { display: flex; width: 100%; white-space: normal; text-align: center; margin: 4px 0 10px; }

/* Data do evento no resultado: etiqueta em vez de emoji. */
.event-chip { display: inline-block; margin: 0 0 12px; padding: 5px 14px; border-radius: 999px;
  background: #fbf0d2; border: 1.5px solid #e3b54a; font-size: 0.9375rem; }
.wish-del { margin-left: auto; padding: 4px 8px; color: var(--muted); }
.wish-form { display: flex; gap: 8px; flex-wrap: wrap; }
.wish-form input[type=text] { flex: 2 1 220px; width: auto; }
.wish-form input[name=url] { flex: 1 1 160px; }
.wish-person .person-rules { padding-top: 4px; }
.reveal-wishes { text-align: left; }
.reveal-wishes h2 { margin-top: 0; font-size: 1.0625rem; }
.reveal-wishes .btn { margin-top: 4px; }
.reveal-invite { text-align: left; }
.reveal-invite h2 { margin-top: 0; font-size: 1.0625rem; }
.reveal-invite .btn { white-space: normal; width: 100%; text-align: center; margin-top: 4px; }
.wishes-linkbox { flex-wrap: wrap; }
.wishes-linkbox input { flex: 1 1 240px; }
.reveal-wishes .btn { white-space: normal; width: 100%; text-align: center; }
.wishes-linkbox .btn { white-space: normal; }

/* Seção Avançado */
.adv-title { display: block; color: var(--text); font-size: 0.9375rem; margin-bottom: 2px; }
#delete-section .card p { margin-bottom: 0; }
#delete-section .linkbox { margin-top: 10px; }

/* ---------- Acessibilidade ---------- */
/* Texto só para leitores de tela */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* A barra fixa do sorteio não pode esconder o elemento com foco */
html { scroll-padding-bottom: 140px; }
/* Foco sempre visível, inclusive em botões "transparentes" */
.person-toggle:focus-visible, .sent-toggle:focus-visible, .chip-x:focus-visible, .combo-option:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1.name:focus { outline: none; }
.reveal h1.name { margin: 8px 0 20px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.sent-static { padding: 6px 8px; margin: -6px 0 -6px -8px; }

/* Tela baixa (zoom alto ou celular deitado): a barra do sorteio deixa de ser fixa
   para não cobrir boa parte do conteúdo. */
@media (max-height: 500px) {
  .draw-bar { position: static; box-shadow: none; }
  html { scroll-padding-bottom: 0; }
}
/* Botões só com ícone (✏️ 🗑️ 🔗 ✕): área de toque mínima em todos os navegadores */
.icon-btn { min-width: 32px; min-height: 32px; }

/* Aviso de aba desatualizada */
.stale-banner {
  position: sticky; top: 8px; z-index: 30;
  display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 14px;
  background: var(--warn-soft); color: #5f4310;
  border: 1px solid var(--warn-border); border-left: 4px solid var(--warn); border-radius: 10px;
  font-size: 0.875rem;
}
.stale-banner strong { display: block; color: var(--warn); font-size: 0.9375rem; }
.stale-banner > span { flex: 1 1 260px; }
@media (max-height: 500px) { .stale-banner { position: static; } }

/* Modo de diagnóstico dos contatos (?diagnostico=contatos) */
.diag-panel { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--muted); border-radius: 10px; background: var(--bg); }
.diag-panel pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 0.75rem; max-height: 50vh; overflow: auto; }

/* Aviso fixo quando o celular não entrega os contatos */
.contacts-notice {
  display: flex; gap: 8px 12px; align-items: flex-start; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: var(--warn-soft); color: #5f4310;
  border: 1px solid var(--warn-border); border-left: 4px solid var(--warn); border-radius: 10px;
  font-size: 0.875rem;
}
.contacts-notice strong { display: block; color: var(--warn); font-size: 0.9375rem; }
.contacts-notice > span:first-child { flex: 1 1 240px; }
.contacts-notice-actions { display: flex; gap: 6px; align-items: center; }
.contacts-notice .small-btn { background: var(--surface); }
.diag-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.diag-steps { margin: 8px 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.diag-steps li { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.diag-steps .small-btn { background: var(--surface); }
.diag-hint { font-size: 0.8125rem; color: var(--muted); }
.diag-done { margin: 6px 0; font-weight: 600; color: var(--ok); }

/* Rodapé e página de privacidade */
/* Rodapé: fica no fim da página mesmo quando o conteúdo é curto. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main.wrap { flex: 1 0 auto; width: 100%; }
.foot { font-size: 0.75rem; color: var(--muted); }
.foot-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px 18px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.foot-inner strong { font-weight: 600; }
.foot a { color: var(--muted); }
.legal h1 { margin-top: 0; }
.legal h2 { font-size: 1.0625rem; margin: 20px 0 6px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }

/* ---------- Marca: ilustração da roda, chegada do trem no resultado e ícone de presente ---------- */
:root { --icone-presente: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2016%2016%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cg%20stroke%3D%27%230f2a20%27%20stroke-width%3D%271.2%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%272%27%20y%3D%276%27%20width%3D%2712%27%20height%3D%278%27%20rx%3D%271%27%20fill%3D%27%23f0c457%27%2F%3E%3Crect%20x%3D%271.5%27%20y%3D%274%27%20width%3D%2713%27%20height%3D%273%27%20rx%3D%271%27%20fill%3D%27%23f0c457%27%2F%3E%3Cpath%20d%3D%27M8%204v10%27%20stroke%3D%27%23b0223f%27%20stroke-width%3D%271.6%27%2F%3E%3Cpath%20d%3D%27M8%204C6%201%203.5%201.8%204.5%203.6M8%204c2-3%204.5-2.2%203.5-.4%27%20fill%3D%27none%27%20stroke%3D%27%23b0223f%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.icone { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 6px; background: var(--icone-presente) center / contain no-repeat; }

.hero { display: flex; align-items: center; gap: 20px; margin: 28px 0 8px; }
.hero-art svg { width: 180px; height: 180px; display: block; }
.hero-text { margin: 0; font-size: 1.0625rem; }
.hero-text strong { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.375rem; display: block; color: var(--accent); }
.gira { transform-box: view-box; transform-origin: 24px 25px; animation: gira 14s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .hero { flex-direction: column; text-align: center; gap: 8px; } .hero-art svg { width: 200px; height: 200px; } }

/* Resultado: o trem chega e entrega o nome. */
.reveal .gift svg { animation: chega 1s cubic-bezier(.2, .8, .2, 1) both; }
.reveal h1.name { animation: entrega .55s .75s cubic-bezier(.2, .8, .2, 1) both; }
/* O trem anda para a esquerda (a locomotiva vai na frente), então chega pela direita. */
@keyframes chega { from { transform: translateX(160%); } to { transform: none; } }
@keyframes entrega { from { transform: translateY(-12px) scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .gira, .reveal .gift svg, .reveal h1.name { animation: none; }
}
.brand:focus-visible { outline-color: var(--mustard); outline-offset: 4px; }
