*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg1: #eef2ff;
  --bg2: #f8fafc;
  --ink: #0f172a;
  --radius: 22px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.35;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 60%) fixed;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- Tela inicial: só as enquetes ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; gap: 16px; }
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 24px -6px rgba(15, 23, 42, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 32px -8px rgba(15, 23, 42, .28); }
.card:active { transform: scale(.98); }
.card:focus-visible { outline: 3px solid #6366f1; outline-offset: 3px; }

.card img, .card .noimg {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.card-title { padding: 14px 16px 18px; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }

/* ---------- Página da enquete (visual de app) ---------- */
.poll-page { display: flex; justify-content: center; }
.poll {
  width: 100%;
  max-width: 480px;
  margin: 18px 14px 40px;
  padding: 22px 18px 24px;
  text-align: center;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 24px 48px -12px rgba(15, 23, 42, .25);
}
.poll h1 {
  font-size: clamp(1.35rem, 5.5vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 2px 0 16px;
}
.poll-headline {
  margin: 0 0 24px;
  font-weight: 700;
  line-height: 1.15;
  color: #0f172a;
  text-align: center;
  overflow-wrap: anywhere;
}
.poll-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 22px;
  border-radius: 18px;
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .4);
}

.poll-buttons { display: flex; flex-direction: column; gap: 16px; padding-bottom: 6px; }

/* Botão com profundidade: base mais escura (3D) + sombra suave + brilho no topo */
.poll-btn {
  --c: #2563eb;
  --c-dark: #1b4fb8;
  --c-text: #fff;
  position: relative;
  display: block;
  padding: 19px 18px;
  color: var(--c-text);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff) 0%, var(--c) 55%);
  background-color: var(--c);
  box-shadow:
    0 6px 0 var(--c-dark),
    0 14px 20px -4px rgba(15, 23, 42, .35),
    inset 0 2px 0 rgba(255, 255, 255, .35);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.poll-btn:hover { filter: brightness(1.06); }
.poll-btn:active {
  transform: translateY(5px);
  box-shadow:
    0 1px 0 var(--c-dark),
    0 4px 8px -2px rgba(15, 23, 42, .3),
    inset 0 2px 0 rgba(255, 255, 255, .25);
}
.poll-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 4px; }

/* ---------- Aviso em tela cheia ---------- */
.aviso {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0b0b14 75%);
  color: #fde047;
  text-align: center;
  animation: aviso-in .2s ease-out;
}
.aviso[hidden] { display: none; }
.aviso-texto {
  margin: 0;
  max-width: 1000px;
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 4px 24px rgba(253, 224, 71, .35);
}
.aviso-contagem {
  display: grid;
  place-items: center;
  width: clamp(120px, 34vw, 240px);
  aspect-ratio: 1;
  margin: 0;
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 6px rgba(253, 224, 71, .55), 0 20px 50px rgba(0, 0, 0, .5);
}
body.lock { overflow: hidden; }

@keyframes aviso-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .card, .poll-btn, .aviso { transition: none; animation: none; }
}
