/* Rifa do John — paleta quente (creme/coral/teal), celular primeiro. */
:root {
  --creme: #fff8f2;
  --papel: #ffffff;
  --tinta: #2e2320;
  --suave: #7b6a62;
  --linha: #f0e2d8;
  --coral: #e8563f;
  --coral-escuro: #c8402c;
  --teal: #1f7a6c;
  --dourado: #e3a008;
  --sombra: 0 2px 10px rgba(46, 35, 32, 0.07);
  --raio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--tinta);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.envoltorio { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }

/* ---------- topo ---------- */

header.capa {
  position: relative;
  border-bottom: 1px solid var(--linha);
  padding: 16px 16px 18px;
  text-align: center;
  /* Fotos do John desfocadas por baixo de um véu quente: dá o clima sem atrapalhar a leitura. */
  background:
    linear-gradient(180deg, rgba(255, 233, 217, 0.9) 0%, rgba(255, 217, 198, 0.88) 55%, rgba(255, 203, 179, 0.94) 100%),
    url("/fotos/capa-fundo.jpg") center / cover no-repeat;
}
header.capa .retrato {
  display: block; width: 92px; height: 92px; margin: 0 auto 10px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(120, 60, 35, 0.22);
}
header.capa h1 { margin: 0 0 5px; font-size: clamp(25px, 6.6vw, 36px); letter-spacing: -0.5px; }
header.capa p { margin: 0 auto; max-width: 34ch; color: #6b4b3c; font-size: 15px; }
.selo {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.75); color: var(--coral-escuro);
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
}

/* ---------- abas ---------- */

nav.abas {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; padding: 8px 12px;
  background: rgba(255, 248, 242, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linha);
  overflow-x: auto; scrollbar-width: none;
}
nav.abas::-webkit-scrollbar { display: none; }
nav.abas button {
  flex: 1 0 auto; padding: 9px 12px; border: none; border-radius: 999px;
  background: transparent; color: var(--suave);
  font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
nav.abas button[aria-selected="true"] { background: var(--tinta); color: #fff; }

/* ---------- blocos ---------- */

section.painel { display: none; }
section.painel.ativo { display: block; }

.cartao {
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 18px; margin: 16px 0;
}
.cartao h2 { margin: 0 0 10px; font-size: 19px; }
.cartao h3 { margin: 18px 0 8px; font-size: 16px; }
.cartao p { margin: 0 0 10px; }
.cartao p:last-child { margin-bottom: 0; }

.premio {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(135deg, #fffdf6, #fff5e0);
  border: 1px solid #f6e3b8;
}
.premio .icone { font-size: 34px; line-height: 1; }
.premio strong { display: block; font-size: 17px; }
.premio span { color: var(--suave); font-size: 14px; }

ol.passos { margin: 0; padding-left: 22px; }
ol.passos li { margin-bottom: 8px; }
ol.passos li:last-child { margin-bottom: 0; }

.aviso {
  background: #fff4f1; border: 1px solid #ffd5cb; border-left: 4px solid var(--coral);
  border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: #7a3427;
}

/* ---------- barra de progresso ---------- */

.progresso { margin: 14px 0 4px; }
.progresso .trilha { height: 12px; border-radius: 999px; background: #f2e5dc; overflow: hidden; }
.progresso .barra { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--coral), var(--dourado)); transition: width 0.5s ease; }
.progresso .numeros { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--suave); }
.progresso .numeros strong { color: var(--tinta); }

/* ---------- grade dos números ---------- */

.grade {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px;
}
@media (min-width: 480px) { .grade { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 680px) { .grade { grid-template-columns: repeat(10, 1fr); } }

.numero {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--linha); border-radius: 10px; background: var(--papel);
  color: var(--tinta); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.numero:active { transform: scale(0.94); }
.numero[data-estado="escolhido"] { background: var(--coral); border-color: var(--coral); color: #fff; }
.numero[data-estado="ocupado"] { background: #f4efeb; border-color: #eae0d8; color: #b6a69d; cursor: not-allowed; }
.numero[data-estado="ocupado"]::after {
  content: attr(data-quem); position: absolute; bottom: 3px; left: 2px; right: 2px;
  font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85;
}
.numero[data-estado="pago"] { background: #eaf6f3; border-color: #cfe9e2; color: var(--teal); }

.legenda { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--suave); }
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--linha); background: var(--papel); }
.legenda i.escolhido { background: var(--coral); border-color: var(--coral); }
.legenda i.ocupado { background: #f4efeb; border-color: #eae0d8; }
.legenda i.pago { background: #eaf6f3; border-color: #cfe9e2; }

/* ---------- carrinho fixo ---------- */

.carrinho {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--linha);
  box-shadow: 0 -4px 16px rgba(46, 35, 32, 0.08);
}
.carrinho.visivel { display: flex; }
.carrinho .resumo { flex: 1; min-width: 0; font-size: 14px; }
.carrinho .resumo strong { display: block; font-size: 16px; }
.carrinho .resumo span { color: var(--suave); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button.principal {
  padding: 13px 22px; border: none; border-radius: 999px;
  background: var(--coral); color: #fff; font: inherit; font-weight: 700; font-size: 15px;
  cursor: pointer; box-shadow: 0 3px 10px rgba(232, 86, 63, 0.3);
}
button.principal:disabled { background: #d9cdc6; box-shadow: none; cursor: default; }
button.secundaria {
  padding: 11px 18px; border: 1.5px solid var(--linha); border-radius: 999px;
  background: var(--papel); color: var(--tinta); font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- modal ---------- */

.fundo {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: flex-end; justify-content: center; padding: 0;
  background: rgba(46, 35, 32, 0.45);
}
.fundo.aberto { display: flex; }
@media (min-width: 560px) { .fundo { align-items: center; padding: 16px; } }

.modal {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--papel); border-radius: 18px 18px 0 0; padding: 20px;
}
@media (min-width: 560px) { .modal { border-radius: 18px; } }
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { margin: 0 0 16px; color: var(--suave); font-size: 14px; }

label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
label span { display: block; margin-bottom: 5px; }
input[type="text"], input[type="tel"], input[type="password"] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--linha); border-radius: 10px;
  background: var(--creme); color: var(--tinta); font: inherit; font-weight: 400;
}
input:focus-visible, button:focus-visible { outline: 2.5px solid var(--coral); outline-offset: 2px; }

.escolhidos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.escolhidos b {
  padding: 4px 10px; border-radius: 999px; background: #fff0eb; color: var(--coral-escuro);
  font-size: 13px; font-weight: 700;
}
.total { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--creme); font-size: 15px; }
.total strong { font-size: 20px; }

.pix { background: #eaf6f3; border: 1px solid #cfe9e2; border-radius: 12px; padding: 14px; margin: 14px 0; }
.pix .chave {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  padding: 12px; border-radius: 10px; background: var(--papel); border: 1px dashed #a9d6cb;
}
.pix .chave code { flex: 1; font-size: 17px; font-weight: 700; color: var(--teal); }
.recado { margin-top: 12px; font-size: 13.5px; color: var(--suave); }

.erro { margin: 0 0 12px; padding: 11px 13px; border-radius: 10px; background: #fdecea; border: 1px solid #f7c9c2; color: #9b2c1b; font-size: 14px; }
.sucesso { margin: 0 0 12px; padding: 11px 13px; border-radius: 10px; background: #eaf6ef; border: 1px solid #c3e6d0; color: #1c6b41; font-size: 14px; }

/* ---------- laudos e fotos ---------- */

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.galeria figure { margin: 0; border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; background: var(--papel); }
.galeria img, .galeria video { display: block; width: 100%; height: 150px; object-fit: cover; background: #f4efeb; }
.galeria figcaption { padding: 8px 10px; font-size: 13px; color: var(--suave); }

.docs { list-style: none; margin: 14px 0 0; padding: 0; }
.docs li { margin-bottom: 8px; }
.docs a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--linha); border-radius: 12px; background: var(--papel);
  color: var(--tinta); text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.docs a small { margin-left: auto; color: var(--suave); font-weight: 400; }

.vazio { padding: 26px 18px; text-align: center; color: var(--suave); font-size: 14.5px; }
.vazio .icone { font-size: 32px; display: block; margin-bottom: 8px; }

/* ---------- admin ---------- */

table.reservas { width: 100%; border-collapse: collapse; font-size: 14px; }
table.reservas th, table.reservas td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--linha); }
table.reservas th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--suave); }
table.reservas td.acoes { text-align: right; white-space: nowrap; }
table.reservas button { padding: 5px 10px; margin-left: 4px; border: 1px solid var(--linha); border-radius: 8px; background: var(--papel); font: inherit; font-size: 12.5px; cursor: pointer; }
table.reservas .pago td:first-child { color: var(--teal); font-weight: 700; }
.rolagem { overflow-x: auto; }

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.indicadores div { padding: 12px; border: 1px solid var(--linha); border-radius: 12px; background: var(--papel); }
.indicadores strong { display: block; font-size: 20px; }
.indicadores span { font-size: 12.5px; color: var(--suave); }

footer.pe { padding: 26px 16px 40px; text-align: center; color: var(--suave); font-size: 13px; }

/* Botão da live do sorteio (só aparece quando config.linkLive está preenchido). */
.botao-live {
  display: block; margin-top: 12px; padding: 14px; border-radius: 12px;
  background: var(--tinta); color: #fff; text-align: center; text-decoration: none;
  font-weight: 700; font-size: 15px;
}
.botao-live::before { content: "● "; color: #ff5b5b; }

/* ---------- tira de fotos da home ---------- */

.tira {
  display: flex; gap: 10px; margin: 0 -16px 16px; padding: 2px 16px 6px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tira::-webkit-scrollbar { display: none; }
.tira figure {
  flex: 0 0 auto; width: 74%; max-width: 300px; margin: 0;
  scroll-snap-align: center;
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio);
  box-shadow: var(--sombra); overflow: hidden;
}
.tira img { display: block; width: 100%; height: 230px; object-fit: cover; background: #f4efeb; }

/* Tela larga: grade em vez de rolagem lateral — rolando, a última foto ficava cortada na borda e
   parecia defeito (relato do dono, 17/09). No celular a tira continua deslizando de lado. */
@media (min-width: 560px) {
  .tira {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; margin: 0 0 16px; padding: 0; overflow: visible;
  }
  .tira figure { width: auto; max-width: none; }
  .tira img { height: 225px; }
}
.tira figcaption { padding: 9px 12px; font-size: 13.5px; color: var(--suave); }
/* Legenda com altura mínima de duas linhas: sem isso os cards da mesma fileira ficavam com
   alturas diferentes e sobrava um vão branco embaixo dos de legenda curta. */
@media (min-width: 560px) { .tira figcaption { min-height: 2.9em; } }

.nota-meta { margin: 10px 0 0; font-size: 13.5px; color: var(--suave); }
