/* ============================================================
   Escapadinha a Dois — Base (reset, corpo, tipografia, utils)
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-touch-callout: none;
}

img { display: block; max-width: 100%; }

/* Ícones inline: tamanho por defeito relativo ao texto (componentes podem sobrepor) */
svg { flex-shrink: 0; }
button > svg, a > svg, .btn svg, .pill svg, .glass-pill svg, .list-btn svg, .tl-chev svg, .next-row > svg, .vote-chip svg, .check .box svg, .surprise-title svg, .rules summary svg { width: 1.15em; height: 1.15em; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; touch-action: manipulation; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

::selection { background: var(--accent-pale); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* App shell — mobile-first, centrado em ~480px */
#app[hidden] { display: none; }

#app {
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100svh;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-banner);
  padding: calc(12px + var(--safe-t)) 18px 12px;
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

main {
  flex: 1;
  padding: 18px 18px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  -webkit-overflow-scrolling: touch;
}

@media (display-mode: standalone) {
  #topbar { padding-top: calc(10px + var(--safe-t)); }
  main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 34px); }
}

/* Secções das tabs */
.view { display: block; }
.view[hidden] { display: none; }

/* Utilidades */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }

/* Scrollbar discreta (apenas desktop) */
@media (min-width: 600px) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
}

/* Redução de movimento — crossfade/instantâneo */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
