:root {
  --bg: #1E3A2B;
  --surface: #284A38;
  --line: #3B634C;
  --line-soft: #4E7A5E;
  --brown: #4A3324;
  --brown-line: #6E4E38;
  --terra: #A04A2A;
  --terra-text: #E0956C;
  --gold: #D4AF5E;
  --cream: #F4ECDD;
  --paper: #F3E9D6;
  --ink: #4A3324;
  --text-2: #DCE3D6;
  --muted: #C9D2C2;
  --muted-2: #A9B8A9;
  --tan: #E2D3C2;
  --tabbar: #172F22;
  --display: 'Marcellus', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #142a1f;
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: var(--body); }
a { color: var(--gold); }

.app {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 520px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

.test-banner {
  background: var(--gold);
  color: #1E3A2B;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: .5px;
}

.screen { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 28px 20px 28px; }
.screen.with-tabs { padding-bottom: 170px; }
.center { align-items: center; text-align: center; }

/* tipografia */
.h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2; }
.h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.25; }
.display-xl { margin: 0; font-family: var(--display); font-weight: 400; font-size: 56px; letter-spacing: 2px; line-height: 1; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--terra-text); }
.eyebrow.gold { color: var(--gold); }
.eyebrow.muted { color: var(--muted); }
.p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.small { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tiny { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted-2); }
.quote { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.5; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: none;
  background: var(--terra); color: var(--cream); font-size: 16px; font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.btn.light { background: var(--cream); color: var(--ink); }
.btn.sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn.link { background: transparent; color: var(--gold); min-height: 44px; font-weight: 600; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.back {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line);
  background: transparent; color: var(--cream); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn:focus-visible, .back:focus-visible, .tile:focus-visible, .tab:focus-visible, .chip:focus-visible, .card-btn:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* cartões */
.card { padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.card.brown { background: var(--brown); border-color: var(--brown-line); }
.card.terra { background: var(--terra); border-color: var(--terra); }
.card.accent { border-color: var(--gold); }
.card.paper { background: var(--paper); border-color: var(--gold); color: var(--ink); }
.locked { padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-soft); display: flex; gap: 12px; align-items: flex-start; }

.tile {
  padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  color: var(--cream); text-align: left; cursor: pointer; display: flex; gap: 16px; align-items: center; width: 100%;
}
.tile.brown { background: var(--brown); border-color: var(--brown-line); }
.tile .thumb { flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.tile-col { display: flex; flex-direction: column; gap: 6px; }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini {
  padding: 14px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  color: var(--cream); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; text-align: center;
}
.mini img { height: 76px; width: auto; border-radius: 6px; }

.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 18px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--cream); cursor: pointer; width: 100%; }
.nums span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nums b { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--gold); }
.nums small { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* formulários */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--cream); font-size: 16px; font-family: var(--body); width: 100%;
}
textarea.input { line-height: 1.5; resize: vertical; }
input[type="date"].input { color-scheme: dark; }
.input::placeholder { color: #93A596; }
.error { margin: 0; font-size: 14px; color: #F2A98C; }

/* segmentado */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 44px; border-radius: 999px; border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .5px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--terra); color: var(--cream); }

/* chips de dia/horário */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--cream); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 16px; font-weight: 600; }
.chip small { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1E3A2B; }

/* cartas */
.oracle-card { border-radius: 14px; box-shadow: 0 16px 36px rgba(0,0,0,.35); }
.ph-card {
  border-radius: 10px; background: var(--paper); border: 1px solid var(--gold); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 6px;
  aspect-ratio: .71; width: 100%;
}
.ph-card b { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; }
.ph-card span { font-size: 11px; line-height: 1.2; }
.card-btn { padding: 0; border: 1px solid var(--gold); border-radius: 10px; background: transparent; cursor: pointer; width: 100%; aspect-ratio: .71; overflow: hidden; }
.card-btn img { width: 100%; height: 100%; object-fit: cover; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.slot p { margin: 0; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); }
.slot p.on { color: var(--gold); }
.face-down {
  border-radius: 12px; border: 1px solid var(--gold); background: var(--brown); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 16px 36px rgba(0,0,0,.35);
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-soft); font-size: 14px; }
.row { display: flex; gap: 14px; align-items: flex-start; }
.row.center-y { align-items: center; }
.col { display: flex; flex-direction: column; gap: 4px; }
.tag { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--terra-text); font-size: 12px; color: var(--terra-text); }
.num-badge { flex-shrink: 0; width: 28px; height: 28px; border-radius: 14px; border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--gold); }
.logo-box { display: flex; justify-content: center; padding: 10px; border-radius: 18px; background: #fff; }

/* vovó */
.vovo-hand { font-family: var(--hand); font-size: 30px; line-height: 1; }

/* abas */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: 78px; padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; background: var(--tabbar); border-top: 1px solid var(--line); z-index: 10;
}
.tab { flex: 1; min-height: 52px; border: none; background: transparent; color: var(--muted-2); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.tab[aria-current="page"] { color: var(--gold); }

.fade { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } }

/* WhatsApp: botão flutuante e botão quadrado ao lado do pagar */
.wa-fab {
  position: fixed; z-index: 11; width: 56px; height: 56px; border-radius: 28px;
  right: max(16px, calc(50% - 240px + 16px)); bottom: calc(20px + env(safe-area-inset-bottom));
  background: #1FA855; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); text-decoration: none;
}
.wa-fab.up { bottom: calc(92px + env(safe-area-inset-bottom)); }
.wa-fab svg { width: 28px; height: 28px; }
.wa-fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn.wa-sq { width: 52px; min-width: 52px; padding: 0; background: #1FA855; color: #fff; }

/* aviso de cookies */
.cookie-bar {
  position: fixed; z-index: 12; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom)); width: calc(100% - 24px); max-width: 456px;
  background: var(--brown); border: 1px solid var(--brown-line); border-radius: 18px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
