@font-face { font-family: Funnel; src: url('/fonts/FunnelDisplay.ttf'); font-display: swap; }
@font-face { font-family: Nunito; src: url('/fonts/Nunito.ttf'); font-display: swap; }

:root {
  --bg: #f4f3f8;
  --card: #ffffff;
  --ink: #17174a;
  --muted: #6c6c82;
  --line: #e3e1ee;
  --skel: #e7e5f0;
  --grad: linear-gradient(90deg, #00c8ff 0%, #5b46ff 50%, #e0359b 100%);
  --violet: #5b46ff;
  --ok: #12a36b;
  --danger: #d23c5a;
  --shadow: 0 10px 28px rgba(40, 30, 90, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Nunito, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 16px 140px; }
.tag { font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--violet); font-weight: 800; }
h1 { font-family: Funnel, sans-serif; font-size: clamp(32px, 6vw, 52px); line-height: 1.05; letter-spacing: -0.5px; margin-top: 8px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: #3c3960; margin-top: 10px; }

/* categoria */
.cat { margin-top: 44px; scroll-margin-top: 20px; }
.cat-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.cat-num { font-family: Funnel, sans-serif; font-weight: 700; font-size: 40px; line-height: 1; }
.cat-title { font-family: Funnel, sans-serif; font-size: clamp(22px, 3.4vw, 32px); line-height: 1.1; }
.cat-done { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.cat.missing .cat-title::after { content: ' · falta escolher'; color: var(--danger); font-family: Nunito, sans-serif; font-size: 15px; font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.opt { position: relative; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: left; transition: transform .15s ease; }
.opt:active { transform: scale(.985); }
.opt .ph { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--skel); }
.opt .ph img { width: 100%; height: 100%; object-fit: cover; }
.opt .meta { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; }
.chip { display: inline-block; font-family: Funnel, sans-serif; font-weight: 700; font-size: 13px; color: #fff; background: var(--grad); padding: 3px 11px; border-radius: 20px; }
.chip.cur { background: #8a87a8; }
.opt .zoom { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.opt .zoom:hover { background: var(--bg); }
.opt::after { content: ''; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px); padding: 3px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .15s; pointer-events: none; }
.opt[aria-pressed='true']::after { opacity: 1; }
.check { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(91, 70, 255, .4); transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.opt[aria-pressed='true'] .check { transform: scale(1); }

/* barra fixa */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 20; }
.bar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--violet); }
.count { font-weight: 800; font-size: 15px; }
.btn { margin-left: auto; font-family: Funnel, sans-serif; font-weight: 700; font-size: 17px; color: #fff; background: var(--grad); padding: 13px 22px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(91, 70, 255, .3); white-space: nowrap; }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 1.5px solid var(--line); }
@media (max-width: 420px) { .dots { display: none; } }

/* modal / lightbox */
.overlay { position: fixed; inset: 0; background: rgba(15, 14, 40, .72); z-index: 40; display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.open { display: flex; }
.sheet { background: var(--card); border-radius: 22px; width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; padding: 24px 20px; }
.sheet h2 { font-family: Funnel, sans-serif; font-size: 28px; line-height: 1.1; }
.sheet p.note { color: var(--muted); margin-top: 6px; }
.sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 620px) { .sum { grid-template-columns: repeat(4, 1fr); } }
.sum figure img { aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; width: 100%; background: var(--skel); }
.sum figcaption { font-size: 12.5px; font-weight: 800; margin-top: 5px; line-height: 1.25; }
.sum figcaption span { display: block; color: var(--muted); font-weight: 700; }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

.lb { flex-direction: column; gap: 14px; }
.lb img { max-width: min(1280px, 100%); max-height: 74vh; border-radius: 14px; background: #222; }
.lb .lb-bar { display: flex; align-items: center; gap: 10px; color: #fff; width: min(1280px, 100%); }
.lb .lb-bar .chip { font-size: 15px; }
.lb .nav { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; }
.lb .close { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; }

/* estados */
.state { max-width: 560px; margin: 12vh auto 0; text-align: center; padding: 0 16px; }
.state .ico { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 36px; color: #fff; background: var(--grad); }
.state h1 { font-size: 34px; }
.state p { color: #3c3960; margin-top: 10px; font-size: 17px; }
.state .btn { display: inline-block; margin: 22px auto 0; }
.skel { background: var(--skel); border-radius: 10px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .check, .opt { transition: none; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700;
  z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* lightbox: fundo escuro de verdade e barra em 2 linhas no celular */
.overlay.lb { background: rgba(10, 10, 30, 0.94); }
.lb .lb-bar { flex-wrap: wrap; }
.lb .lb-bar .chip { white-space: nowrap; }
.lb #lb-cat { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .lb .lb-bar .btn { margin-left: 0; width: 100%; }
}
