/* Desafio 360 — estilos (sem fontes ou bibliotecas externas)
 * As cores principal/destaque, os cantos e o modo claro/escuro vêm do painel (Aparência):
 * theme_head() imprime um <style> depois deste arquivo sobrescrevendo as variáveis abaixo. */
:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f1eff8;
  --text: #1d1b26;
  --muted: #6b6880;
  --border: #e3e0ef;
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --primary-soft: #ede9fe;
  --primary-text: #5b21b6;
  --primary-ink: #6d28d9;
  --on-primary: #ffffff;
  --accent: #e8590c;
  --accent-dark: #be4a0a;
  --accent-soft: #fdebdf;
  --accent-text: #a63f08;
  --accent-ink: #b94a0a;
  --on-accent: #ffffff;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius: 18px;
  --radius-sm: calc(var(--radius) * .6);
  --shadow: 0 1px 2px rgba(20, 10, 50, .05), 0 6px 20px rgba(20, 10, 50, .06);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #14121c; --surface: #1e1b29; --surface-2: #262235; --text: #f1eff8; --muted: #a6a2ba; --border: #322e44;
    --primary: #a78bfa; --primary-dark: #b9a3fb; --primary-soft: #2e2547; --primary-text: #c4b5fd; --primary-ink: #a78bfa; --on-primary: #14121c;
    --accent: #f08a50; --accent-dark: #f3a274; --accent-soft: #3a2418; --accent-text: #f6b48d; --accent-ink: #f08a50; --on-accent: #14121c;
    --success: #4ade80; --success-soft: #133222; --warn: #fbbf24; --warn-soft: #3a2c0f; --danger: #f87171; --danger-soft: #3b1515;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #14121c; --surface: #1e1b29; --surface-2: #262235; --text: #f1eff8; --muted: #a6a2ba; --border: #322e44;
  --primary: #a78bfa; --primary-dark: #b9a3fb; --primary-soft: #2e2547; --primary-text: #c4b5fd; --primary-ink: #a78bfa; --on-primary: #14121c;
  --accent: #f08a50; --accent-dark: #f3a274; --accent-soft: #3a2418; --accent-text: #f6b48d; --accent-ink: #f08a50; --on-accent: #14121c;
  --success: #4ade80; --success-soft: #133222; --warn: #fbbf24; --warn-soft: #3a2c0f; --danger: #f87171; --danger-soft: #3b1515;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary-ink); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
code { font-size: .9em; }

.container { max-width: 680px; margin: 0 auto; padding: 16px 16px 48px; }
/* painel: usa toda a largura da tela, com margem lateral que cresce com ela */
.container-wide { max-width: none; padding-left: clamp(16px, 2.4vw, 40px); padding-right: clamp(16px, 2.4vw, 40px); }
/* cards independentes lado a lado: quantas colunas couberem (cada uma com pelo menos 440px, ou 640px em .cards-wide) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.cards-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 640px), 1fr)); }
.cards > .card { margin: 0; }
.user-active { align-self: end; padding-bottom: 10px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { font-size: 1.3rem; }
.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .95rem; }
.topnav a { color: var(--text); text-decoration: none; }
.inline { display: inline; margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.wrap { flex-wrap: wrap; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero { text-align: center; padding: 20px 0 8px; }
.hero-compact { padding-top: 8px; }

label { font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.input-prefix span { padding: 11px 8px 11px 12px; background: var(--bg); color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.input-prefix input { border: 0; border-radius: 0; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  font: inherit; font-weight: 600;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; cursor: pointer;
  min-height: 44px;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
/* Participantes (painel do evento): Bloquear e Excluir à direita da linha */
.people-actions { margin: 0; gap: 6px; flex-wrap: nowrap; }
.people-actions .btn { min-height: 30px; padding: 4px 10px; font-size: .8rem; border-radius: 8px; }
.btn-whatsapp { background: #25d366; border-color: #1fb457; color: #0b3d1f; }
.btn-whatsapp:hover { background: #1fb457; color: #fff; }
.btn-whatsapp .icon { width: 14px; height: 14px; }
.people-phone { white-space: nowrap; }

/* Armazenamento: espaço ocupado no servidor */
.disk-card { margin-bottom: 16px; }
.dash-disk { margin-top: 16px; }
.disk-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.disk-bar span { display: block; min-width: 3px; }
.disk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.disk-photos { background: var(--primary); }
.disk-system { background: var(--accent); }
.disk-internal { background: var(--warn); }
.disk-db { background: var(--success); }
.disk-list li { align-items: flex-start; gap: 12px; }
.disk-num { text-align: right; white-space: nowrap; }
:root[data-theme=dark] .btn-success, :root[data-theme=dark] .btn-danger { color: #14121c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .btn-success, :root:not([data-theme=light]) .btn-danger { color: #14121c; } }
.btn-lg { padding: 14px 20px; font-size: 1.05rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-ink); font: inherit; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary-text); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); text-decoration: none; }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail { background: var(--danger-soft); color: var(--danger); }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-open { background: var(--success-soft); color: var(--success); }
.status-closed { background: var(--border); color: var(--muted); }
.status-draft { background: var(--warn-soft); color: var(--warn); }
.status-pending { background: var(--primary-soft); color: var(--primary-text); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }

.progress { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .3s; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.tab.active { color: var(--primary-ink); border-bottom-color: var(--primary); }
button.tab { background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 600; cursor: pointer; }
button.tab.active { border-bottom-color: var(--primary); }
.feed-tabs { margin-bottom: 12px; }
.feed-more { display: flex; justify-content: center; margin-top: 14px; }
.feed-more .btn[hidden] { display: none; }

/* ================= Participante ================= */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
body.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
body.public .container { padding-top: 12px; }
body.public .topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 1rem; }
.brand-mark .icon { width: 18px; height: 18px; }
.points-pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  background: var(--accent-soft); color: var(--accent-text); text-decoration: none;
  font-variant-numeric: tabular-nums;
}

/* Barra de navegação inferior (ao alcance do polegar) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-inner { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 680px; }
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.bottomnav a .icon { width: 24px; height: 24px; }
.bottomnav a.active { color: var(--primary-ink); }
.bottomnav a.active .icon { stroke-width: 2.2; }

/* Placar do participante */
.scoreboard {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.ring { position: relative; width: 76px; height: 76px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--primary-soft); }
.ring-fill { stroke: var(--primary); transition: stroke-dashoffset .8s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.score-text { min-width: 0; }
.score-text h1 { font-size: 1.15rem; margin: 0 0 2px; }
.score-text p { margin: 0; color: var(--muted); font-size: .92rem; }
.score-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--text); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-primary { background: var(--primary-soft); color: var(--primary-text); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }

/* Cards de desafio */
.challenges { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.challenge { margin: 0; padding: 16px; transition: border-color .3s, box-shadow .3s; }
.challenge.is-done { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.challenge-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.challenge-head > div { flex: 1; min-width: 0; }
.challenge-head h3 { margin: 2px 0 2px; font-size: 1.05rem; }
.challenge-head p { margin: 0; font-size: .92rem; color: var(--muted); }
.check {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: var(--surface-2); color: var(--muted);
}
.check .icon { width: 18px; height: 18px; stroke-width: 3; }
.challenge.is-done .check { background: var(--success); color: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag { position: absolute; left: 6px; bottom: 6px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag-wait { background: var(--warn-soft); color: var(--warn); }
.thumb-del {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}
.thumb-del .icon { width: 16px; height: 16px; }
.thumb.is-sending img { filter: saturate(.6) brightness(.85); }
.thumb.is-sending::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.btn-upload { width: 100%; min-height: 52px; font-size: 1.02rem; border-radius: var(--radius-sm); }
.btn-upload .icon { width: 22px; height: 22px; }
.upload-progress .progress { margin: 4px 0 6px; }
.limit-note { display: block; text-align: center; margin-top: 8px; }

/* Ranking */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 8px 0 16px; text-align: center; }
.podium-step { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.podium-avatar {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  font-weight: 800; font-size: 1.15rem; background: var(--primary-soft); color: var(--primary-text);
}
.podium-step.p1 .podium-avatar { width: 64px; height: 64px; background: var(--accent); color: var(--on-accent); font-size: 1.4rem; }
.podium-name { font-weight: 700; font-size: .9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-bar {
  width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums;
}
.podium-step.p1 .podium-bar { height: 86px; background: var(--accent-soft); color: var(--accent-text); }
.podium-step.p2 .podium-bar { height: 64px; }
.podium-step.p3 .podium-bar { height: 48px; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.ranking li:last-child { border-bottom: 0; }
.ranking .pos { width: 28px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.ranking .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .pts { font-weight: 700; }
.ranking li.me { background: var(--primary-soft); border-radius: var(--radius-sm); border-bottom-color: transparent; }
.ranking li.me .who, .ranking li.me .pos { color: var(--primary-text); font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

/* Entrada / boas-vindas */
.welcome { text-align: center; padding: 28px 20px; }
.welcome-mark {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; margin-bottom: 12px;
  background: var(--primary); color: var(--on-primary);
}
.welcome-mark .icon { width: 34px; height: 34px; }
.welcome h1 { font-size: 1.6rem; margin-bottom: 6px; }
.welcome .lead { color: var(--muted); }
.welcome form { text-align: left; margin-top: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 4px; }
.steps div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.steps .icon { display: block; margin: 0 auto 4px; width: 22px; height: 22px; color: var(--primary-ink); }

/* Galeria */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row .chip { flex: none; padding: 7px 14px; font-size: .85rem; border: 1px solid var(--border); background: var(--surface); }
.chips-row .chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--radius); overflow: hidden; }
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
.gallery-item { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.04); }
.empty { text-align: center; padding: 32px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--primary-ink); margin-bottom: 8px; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 8px; }
.lightbox-caption { color: #fff; margin-top: 10px; text-align: center; }
.lightbox-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: #fff; font-size: 2.2rem; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; font-weight: 600;
  background: #1d1b26; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  transition: transform .25s; z-index: 60;
}
body.has-nav .toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
.toast.show { transform: translate(-50%, 0); }
.toast-success { background: #15803d; color: #fff; }
.toast-error { background: #b91c1c; color: #fff; }

/* Comemoração ao concluir um desafio */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }
.challenge.celebrate { animation: pop .6s ease; box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 35%, transparent); }
.confetti { position: fixed; z-index: 70; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; animation: confetti 1.1s ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* Aparência (painel): prévia das cores */
.theme-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .theme-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 32%, 520px); align-items: start; } }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 52px; height: 44px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.color-field input[type=text] { font-family: ui-monospace, Consolas, monospace; max-width: 140px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.theme-preview { position: sticky; top: 16px; }
.preview-phone { border: 1px solid var(--border); border-radius: 28px; padding: 14px; background: var(--bg); }

/* Painel */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.page-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.5rem; }
.stat small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface); }
.pill span { color: var(--muted); }
.pill.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill.active span { color: var(--on-primary); }
.bulkbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--bg); padding: 8px 0; margin-bottom: 8px;
}
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mod-item { position: relative; display: block; background: var(--surface); border: 2px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; font-weight: 400; }
.mod-item:has(input:checked) { border-color: var(--primary); }
.mod-item input { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; }
.mod-item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.mod-meta { display: block; padding: 6px 8px; font-size: .8rem; line-height: 1.35; }
.mod-zoom { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); border-radius: 8px; padding: 2px 6px; text-decoration: none; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; }
.pager a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.challenge-form { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: start; }
.challenge-form .cf-main { grid-column: 2; }
.challenge-form .cf-points, .challenge-form .check-row, .challenge-form .btn { grid-column: 2; }
@media (min-width: 820px) {
  .challenge-form { grid-template-columns: 70px 1fr auto auto auto; align-items: center; }
  .challenge-form .cf-main, .challenge-form .cf-points, .challenge-form .check-row, .challenge-form .btn { grid-column: auto; }
}
.cf-points { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.cf-points input { width: 80px; }
.danger-zone { border-color: var(--danger); }

/* ---------- Painel: estrutura (menu lateral / menu no celular) ---------- */
body.admin { --side-w: 248px; }
.shell { min-height: 100vh; }
.sidenav {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: var(--side-w);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidenav .brand { padding: 4px 8px; font-size: 1.1rem; }
.sidenav-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidenav-links a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.sidenav-links a .icon { width: 20px; height: 20px; }
.sidenav-links a:hover { background: var(--surface-2); color: var(--text); }
.sidenav-links a.active { background: var(--primary-soft); color: var(--primary-text); }
.sidenav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 22px; padding-left: 12px; border-left: 1px solid var(--border); }
.sidenav-links .sidenav-sub a { padding: 7px 12px; font-size: .92rem; font-weight: 500; }
.sidenav-links .sidenav-sub a.active { background: none; color: var(--primary-text); font-weight: 700; }
.sidenav-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--border); }
.sidenav-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sidenav-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav-who small { color: var(--muted); }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.icon-btn .icon { width: 20px; height: 20px; }
.shell-main { margin-left: var(--side-w); }
.shell-main .container { padding-top: 24px; }
.sidenav-backdrop { display: none; }
.admin-bottomnav { display: none; }

@media (max-width: 900px) {
  .shell-main { margin-left: 0; }
  .shell-main .container { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .sidenav { transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.menu-open .sidenav { transform: none; }
  body.menu-open .sidenav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .4); }
  .admin-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .admin-bottomnav a, .admin-bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: var(--nav-h); color: var(--muted); text-decoration: none; font: inherit; font-size: .75rem; font-weight: 600;
    background: none; border: 0; cursor: pointer;
  }
  .admin-bottomnav .icon { width: 24px; height: 24px; }
  .admin-bottomnav .active { color: var(--primary-ink); }
  body.admin .toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
}

.btn-ghost { background: transparent; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 1.05rem; }
kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; font: inherit; font-size: .8rem; background: var(--surface); }
.empty { text-align: center; }

/* ---------- Dashboard ---------- */
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--success-soft); color: var(--success); font-weight: 700; font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
.live-badge.is-offline { background: var(--warn-soft); color: var(--warn); }
.live-badge.is-offline .live-dot { animation: none; }
@keyframes blink { 50% { opacity: .25; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 520px) {
  .kpi { padding: 12px; }
  .kpi strong { font-size: 1.6rem; }
  .kpi-icon { width: 30px; height: 30px; top: 10px; right: 10px; }
  .kpi-label { font-size: .78rem; padding-right: 34px; }
  .kpi small { font-size: .75rem; }
  .bar-val, .bar-label { font-size: .62rem; }
  .bars { gap: 3px; height: 170px; }
}
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.kpi-icon {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-text);
}
.kpi-icon .icon { width: 20px; height: 20px; }
.kpi-warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi-label { color: var(--muted); font-size: .85rem; font-weight: 600; padding-right: 44px; }
.kpi strong { font-size: 2rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.kpis-compact .kpi strong { font-size: 1.5rem; }
.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.12); color: var(--primary-ink); } }
.kpi strong.bump { display: inline-block; transform-origin: left center; }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.dash-grid .card { margin: 0; }
@media (min-width: 1100px) {
  .dash-grid { grid-template-columns: 1.4fr 1fr; }
  .dash-feed { grid-column: 1 / -1; }
}

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 200px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bar-val { font-size: .72rem; font-weight: 700; color: var(--muted); height: 1em; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--primary) 45%, var(--surface)); transition: height .6s ease; }
.bar.is-now .bar-fill { background: var(--primary); }
.bar-label { font-size: .7rem; color: var(--muted); }

.live-events { list-style: none; margin: 0; padding: 0; }
.live-event { padding: 10px 0; border-bottom: 1px solid var(--border); }
.live-event:last-child { border-bottom: 0; }
.live-event-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-event-name { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }

.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.feed-item { margin: 0; display: flex; flex-direction: column; gap: 6px; transition: opacity .25s; }
.feed-item.is-busy { opacity: .45; pointer-events: none; }
.feed-item.is-new .feed-img { box-shadow: 0 0 0 3px var(--accent); animation: pop .6s ease; }
.feed-img { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.feed-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-tag { position: absolute; left: 6px; top: 6px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.feed-tag.is-rejected { background: var(--danger-soft); color: var(--danger); }
.feed-item figcaption { display: flex; flex-direction: column; line-height: 1.3; font-size: .85rem; min-width: 0; }
.feed-item figcaption > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.feed-actions .btn { min-height: 36px; padding: 6px 8px; font-size: .85rem; }
.review-list li { gap: 12px; }

/* ---------- Lista de eventos em cartões ---------- */
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.event-card { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.event-card.is-review { border-color: var(--primary); }
.event-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.event-card-head h2 { font-size: 1.1rem; margin: 0 0 2px; }
.event-card-head h2 a { color: var(--text); text-decoration: none; }
.event-card-head p { margin: 0; }
.event-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.event-card-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px; text-align: center; min-width: 0; }
.event-card-stats dt { font-size: .72rem; color: var(--muted); font-weight: 600; }
.event-card-stats dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.event-card-actions .btn { min-height: 40px; padding: 8px 12px; }

/* ---------- Moderação rápida ---------- */
.mod-hint .icon { width: 1em; height: 1em; }
.mod-item { transition: opacity .25s, transform .25s; }
.mod-item:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.mod-item.is-busy { opacity: .5; pointer-events: none; }
.mod-item.is-gone { opacity: 0; transform: scale(.92); }
.mod-zoom { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #fff; }
.mod-zoom .icon { width: 18px; height: 18px; }
.mod-quick { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.mod-quick:has(> :only-child) { grid-template-columns: 1fr; }
.mod-quick button {
  display: grid; place-items: center; height: 44px; border: 0; background: var(--surface); cursor: pointer; color: var(--muted);
}
.mod-quick button + button { border-left: 1px solid var(--border); }
.mod-quick .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.mod-ok:hover, .mod-ok:focus-visible { background: var(--success-soft); color: var(--success); }
.mod-no:hover, .mod-no:focus-visible { background: var(--danger-soft); color: var(--danger); }

/* ---------- Logotipos (Painel > Aparência) ---------- */
.brand-logo { display: block; height: calc(40px * var(--logo-scale, 1)); width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-logo-sm { height: calc(32px * var(--logo-scale, 1)); max-width: 55vw; }
.sidenav .brand-has-logo { padding: 2px 8px; }
.login-logo { display: block; height: calc(96px * var(--logo-scale, 1)); width: auto; max-width: 100%; margin: 4px auto 10px; object-fit: contain; }
body.auth main.container { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 24px; padding-bottom: 24px; }
body.auth .login-card { width: 100%; }
.welcome-logo { display: block; height: calc(96px * var(--logo-scale, 1)); width: auto; max-width: 100%; margin: 0 auto 14px; object-fit: contain; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.brand-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-slot input[type=file] { font: inherit; font-size: .85rem; max-width: 100%; }
.brand-preview {
  display: grid; place-items: center; height: 110px; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%), linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.brand-preview { height: auto; min-height: 110px; }
.brand-preview img { height: calc(48px * var(--logo-scale, 1)); width: auto; max-width: 100%; object-fit: contain; }
.brand-size { display: flex; align-items: center; gap: 10px; }
.brand-size input[type=range] { flex: 1; accent-color: var(--primary); }
.brand-size output { min-width: 3.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.brand-preview.is-square img { width: 64px; height: 64px; }

/* ---------- Rodapé das fotos (Aparência e Configurações do evento) ---------- */
.frame-row { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; }
@media (max-width: 560px) { .frame-row { grid-template-columns: 1fr; } }
.footer-preview { display: block; width: 180px; height: auto; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.frame-actions { min-width: 0; }

/* QR Code para impressão */
.print-page { background: #fff; color: #111; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px; justify-content: center; }
.poster { max-width: 640px; margin: 0 auto; padding: 24px 16px; text-align: center; }
.poster h1 { font-size: 2.2rem; }
.poster-sub { font-size: 1.2rem; color: #555; }
.poster canvas { width: min(100%, 420px); height: auto; image-rendering: pixelated; }
.poster-cta { font-size: 1.15rem; }
.poster-url { font-weight: 700; word-break: break-all; }
@media print {
  .no-print { display: none !important; }
  .poster { padding-top: 0; }
}

/* ---------- Arte de divulgação (imagem 1080 x 1920 com o QR Code) ---------- */
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 900px) { .art-layout { grid-template-columns: minmax(0, 1fr) clamp(380px, 30%, 460px); } .art-preview-card { position: sticky; top: 16px; } }
.art-form { min-width: 0; }
.art-set { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.art-set legend { font-weight: 700; padding: 0 6px; }
.art-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.art-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.art-preset:hover { border-color: var(--primary); }
.art-swatch { width: 26px; height: 26px; border-radius: 50%; flex: none; background: radial-gradient(circle at 50% 50%, var(--p-bg) 34%, transparent 36%), conic-gradient(var(--p-1), var(--p-2), var(--p-3), var(--p-1)); }
.art-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.art-color { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; }
.art-color input[type=color] { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.art-own-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.art-own-logo img { max-height: 56px; max-width: 160px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border-radius: 8px; padding: 4px; }
.art-preview-card { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.art-canvas-wrap { display: flex; justify-content: center; }
.art-canvas-wrap canvas { width: 100%; max-width: 340px; height: auto; aspect-ratio: 1080 / 1920; border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 12, 40, .25); background: var(--surface-2); }

/* ---------- Convites do evento ---------- */
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
/* a prévia fica sempre visível: ao lado do formulário (tela larga) ou presa no topo (tela estreita) */
.inv-aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); z-index: 5; }
@media (min-width: 1100px) { .inv-layout { grid-template-columns: minmax(0, 1fr) minmax(0, clamp(460px, 42%, 860px)); } }
@media (max-width: 1099px) {
  .inv-aside { order: -1; top: env(safe-area-inset-top, 0px); padding-top: 8px; background: var(--bg); }
  .inv-preview-card { padding: 10px 12px; gap: 8px; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
  .inv-preview-card > small { display: none; }
  .inv-prev { padding: 6px; display: flex; justify-content: center; }
  /* convite menor, para sobrar tela para o formulário enquanto rola */
  .inv-prev .convite { width: min(100%, calc(32vh * 1050 / 740)); }
}
.inv-form, .inv-aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.inv-form .card, .inv-aside .card { margin: 0; }
.inv-tabbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.inv-tabs { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.inv-tabbar #invSalvo:empty { display: none; }
.inv-form .card > h2 + .inv-img { padding-top: 0; border-top: 0; }
.inv-camadas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.inv-camadas li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .9rem; font-weight: 600; }
.inv-camada-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); font-size: .75rem; flex: none; }
.inv-camada-nome { flex: 1; min-width: 0; }
.inv-camada-fixa { color: var(--muted); }
.inv-label { font-weight: 600; }
.inv-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.inv-editor:focus-within { border-color: var(--primary); }
.inv-editor textarea { border: 0; border-radius: 0; margin: 0; width: 100%; }
.inv-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg); }
.inv-bar button, .inv-pills button, .inv-tipo-row button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: .9rem; cursor: pointer; }
.inv-bar button:hover, .inv-pills button:hover, .inv-tipo-row button:hover { border-color: var(--primary); }
.inv-bar button.on, .inv-pills button.on, .inv-tipo-row button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.inv-yt { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 10px 10px; padding: 6px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: .85rem; overflow-wrap: anywhere; }
.inv-yt button { border: 0; background: none; color: inherit; font-size: 1.2rem; cursor: pointer; }
.inv-count { text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-pills button { flex: 1; padding: 10px; font-weight: 600; }
.inv-escpos { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.inv-pct { position: relative; }
.inv-pct input { width: 100%; padding-right: 34px; }
.inv-pct span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.inv-pct-row { display: flex; gap: 6px; align-items: stretch; }
.inv-pct-row .inv-pct { flex: 1; min-width: 0; }
.inv-reset { flex: 0 0 46px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 10px; font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.inv-reset:hover { border-color: var(--primary); color: var(--text); }
.inv-reset:disabled { opacity: .4; cursor: default; }
.inv-move { display: flex; gap: 6px; }
.inv-move button { width: 46px; height: 46px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.inv-move button:hover { border-color: var(--primary); }
.inv-move button:disabled { opacity: .4; cursor: default; }
.inv-move [data-dx] { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.inv-move .inv-move-reset { color: var(--muted); }
@media (max-width: 560px) { .inv-escpos { grid-template-columns: 1fr; } .inv-move button { flex: 1; } }
.inv-filter-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.inv-filter-head select { width: auto; max-width: 100%; min-width: 180px; padding-top: 6px; padding-bottom: 6px; font-size: .85rem; }
.lib-tabs { margin-bottom: 4px; }
.lib-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.lib-filter button:hover { border-color: var(--primary); color: var(--text); }
.lib-filter button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.lib-cats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lib-cats-list li { display: flex; gap: 8px; align-items: center; }
.lib-cats-list li > form:first-child { flex: 1; }
.lib-cat-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.lib-cat-row input[type=text] { flex: 1; min-width: 0; padding: 7px 10px; }
.lib-cat-row .muted { white-space: nowrap; }
.inv-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.inv-frame-wrap { position: relative; }
.inv-frame { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; text-align: center; cursor: pointer; }
.inv-frame:hover { border-color: var(--primary); }
.inv-frame.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.inv-thumb { display: grid; place-items: center; aspect-ratio: 7 / 5; border-radius: 8px; background: #fff center / 100% 100% no-repeat; color: var(--muted); font-size: 1.4rem; }
.inv-thumb-none { background: var(--bg); }
.inv-thumb-symbol { aspect-ratio: 1; padding: 12%; background-color: #f3f1f6; background-size: contain; background-origin: content-box; }
.inv-symbols { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.inv-thumb-model { display: block; overflow: hidden; background: none; }
.inv-thumb-model .convite { display: block; height: 100%; aspect-ratio: auto; pointer-events: none; }
.inv-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-size: 1rem; line-height: 1; cursor: pointer; }
.inv-upload { padding: 14px; border: 1px dashed var(--border); border-radius: 12px; }
.inv-tipo { display: flex; flex-direction: column; gap: 8px; }
.inv-tipo-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr) 36px 36px; gap: 8px; align-items: center; }
.inv-tipo-row span { font-size: .85rem; color: var(--muted); }
.inv-tipo-row button { width: 36px; height: 36px; padding: 0; font-weight: 700; }
@media (max-width: 560px) { .inv-tipo-row { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 34px 34px; } .inv-tipo-row button { width: 34px; height: 34px; } }
.inv-row { display: flex; gap: 8px; }
.inv-row input { flex: 1; min-width: 0; }
.inv-file { display: block; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; text-align: center; color: var(--muted); font-weight: 600; cursor: pointer; }
.inv-file:hover { border-color: var(--primary); color: var(--text); }
.inv-img { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.inv-img .inv-row { flex-wrap: wrap; align-items: center; }
.inv-file-btn { cursor: pointer; }
.inv-range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.inv-guests { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.inv-guests li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.inv-guests li:last-child { border-bottom: 0; }
.inv-guests li.on { background: var(--primary-soft); }
.inv-guests .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inv-guests .inv-empty { justify-content: center; color: var(--muted); cursor: default; }
.inv-x { border: 0; background: none; color: var(--muted); font-size: 1.2rem; padding: 0 6px; cursor: pointer; }
.inv-x:hover { color: var(--danger); }
.inv-all { width: 100%; padding: 14px; }
.inv-prev-head { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-ink); }
.inv-prev { padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.inv-prev .convite { border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }

/* ---------- Convites: cadastro de modelos e molduras ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.lib-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.lib-item .convite, .lib-form .convite { border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.lib-item-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lib-item-foot strong { min-width: 0; overflow-wrap: anywhere; }
.lib-swatches { display: flex; flex: none; }
.lib-swatches i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -5px; box-shadow: 0 0 0 1px var(--border); }
.lib-actions { gap: 6px; margin-top: auto; }
.lib-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 900px) { .lib-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.lib-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lib-color { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; }
.lib-color input[type=color] { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.lib-order-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lib-order li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.lib-order-name { flex: 1; min-width: 120px; font-weight: 600; }
.lib-order-esp { display: flex; align-items: center; gap: 8px; margin: 0; }
.lib-order-esp .inv-pct { width: 100px; }
.lib-order-esp input { padding-top: 6px; padding-bottom: 6px; }
.lib-order li.first .lib-order-esp { opacity: .45; }
.lib-order-mv { display: flex; gap: 4px; }
.lib-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lib-frame { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: center; font-size: .85rem; min-width: 0; }
.lib-frame strong { overflow-wrap: anywhere; }
.lib-rename { display: flex; flex-direction: column; gap: 6px; }
.lib-rename input[type=text] { padding: 7px 10px; font-size: .9rem; text-align: center; }
.lib-frame form .btn { width: 100%; }

/* ---------- Telas de entrada (criar evento, login do painel, código do evento) ----------
 * Fundo escuro com os traços neon do site (desafio360.com.br), atrás do cartão do formulário. */
body.cv.fx-page, body.auth.fx-page {
  background:
    radial-gradient(900px 500px at 80% 0%, #2A1470 0%, transparent 60%),
    radial-gradient(700px 420px at 0% 100%, #3A0F4F 0%, transparent 60%),
    #0B0820;
  background-attachment: fixed;
  min-height: 100vh;
}
.fx-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fx-page .cv-app, .fx-page main.container { position: relative; z-index: 1; }
body.cv.fx-page .cv-app { background: transparent; border: 0; }
.fx-s { position: absolute; border-radius: 999px; transform: rotate(-40deg); opacity: .9; }
.fx-s1 { width: 340px; height: 22px; left: -90px; top: 120px; background: linear-gradient(90deg, #D946EF, #FB923C); box-shadow: 0 0 22px rgba(217, 70, 239, .55); }
.fx-s2 { width: 240px; height: 14px; left: -60px; top: 60px; background: linear-gradient(90deg, #22D3EE, #3B82F6); box-shadow: 0 0 18px rgba(34, 211, 238, .55); }
.fx-s3 { width: 300px; height: 22px; right: -80px; top: 110px; background: linear-gradient(90deg, #FB923C, #FACC15); box-shadow: 0 0 22px rgba(250, 204, 21, .5); }
.fx-s4 { width: 380px; height: 22px; right: -120px; bottom: 60px; background: linear-gradient(90deg, #3B82F6, #D946EF); box-shadow: 0 0 22px rgba(217, 70, 239, .5); }
.fx-pill { position: absolute; width: 150px; height: 40px; border: 2px solid #D946EF; border-radius: 999px; transform: rotate(-40deg); opacity: .55; box-shadow: 0 0 18px rgba(217, 70, 239, .5); }
.fx-p1 { left: 3%; top: 62%; }
.fx-p2 { right: 6%; top: 40%; border-color: #A98BFA; }
.fx-page .login-card, .fx-page .cv-signup-form { box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75), 0 0 60px -20px rgba(139, 92, 246, .45); }
.fx-page .cv-top { background: rgba(11, 8, 32, .72); border-bottom-color: rgba(255, 255, 255, .08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (max-width: 640px) {
  .fx-s1, .fx-s3 { width: 200px; }
  .fx-s4 { width: 240px; }
  .fx-pill { display: none; }
}
