/* Vira Latas — mobile first, tema claro por padrão (escuro opcional no Perfil).
   Sistema: 3 níveis de superfície (bg → surface → surface-2), escala de espaços de 4px,
   sombras só em superfícies, emojis só em conteúdo (tipos de evento) e celebração. */
:root {
  --bg: #F7F3EC;
  --surface: #FFFFFF;
  --surface-2: #F3EDE3;
  --surface-3: #EAE1D3;
  --raised: #FFFFFF;
  --ink: #2A1F16;
  --muted: #6E5E4B;
  --line: #ECE3D5;
  --line-strong: #C9B9A3;
  --caramelo: #C0702A;
  --caramelo-ink: #8A4B15;
  --caramelo-soft: #F8E7D3;
  --accent: #A95F1E;
  --on-accent: #FFFFFF;
  --vinho: #8A2F42;
  --vinho-soft: #F6E0E4;
  --mata: #2D6A4C;
  --mata-soft: #DFF0E6;
  --azul: #2A6390;
  --azul-soft: #DEEBF5;
  --grafite: #4A4A4A;
  --grafite-soft: #ECECEC;
  --ambar: #9A6B0B;
  --ambar-soft: #FAEFD2;
  --roxo: #6A4A9C;
  --roxo-soft: #EDE5F7;
  --ok: #23774A;
  --ok-soft: #DDF2E5;
  --erro: #B4361F;
  --erro-soft: #FBE3DC;
  --ouro: #E5B94A;
  --prata: #C4C9D0;
  --bronze: #D99A62;
  --medal-ink: #2A1F16;
  --hairline: 0 0 0 1px rgba(60, 40, 15, .06);
  --shadow-sm: 0 1px 2px rgba(60, 40, 15, .10);
  --shadow: 0 1px 2px rgba(60, 40, 15, .04), 0 4px 14px rgba(60, 40, 15, .05);
  --shadow-lg: 0 2px 6px rgba(60, 40, 15, .06), 0 18px 44px rgba(60, 40, 15, .14);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --radius: var(--r-lg);
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.3rem; --fs-2xl: 1.75rem;
  --ease: cubic-bezier(.2, .8, .2, 1); --t-fast: .12s; --t: .2s; --t-slow: .32s;
  --tabbar-h: 64px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="escuro"] {
  --bg: #15110D; --surface: #201913; --surface-2: #2A211A; --surface-3: #352A21; --raised: #3A2E24; --ink: #F4EBDD;
  --muted: #B6A48C; --line: #342920; --line-strong: #5E4D3D; --caramelo: #E2914A; --caramelo-ink: #F3B67D;
  --caramelo-soft: #3A2716; --accent: #E2914A; --on-accent: #1A120B; --vinho: #E58598; --vinho-soft: #3A1D24;
  --mata: #74C79C; --mata-soft: #18301F; --azul: #7FB6E0; --azul-soft: #172A39; --grafite: #C9C9C9;
  --grafite-soft: #2D2D2D; --ok: #74CE98; --ok-soft: #163222; --erro: #F08D76; --erro-soft: #3C1C15;
  --ambar: #E9C064; --ambar-soft: #362A10; --roxo: #B9A0E6; --roxo-soft: #2A2138;
  --hairline: 0 0 0 1px rgba(255, 236, 210, .06); --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.22);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #15110D; --surface: #201913; --surface-2: #2A211A; --surface-3: #352A21; --raised: #3A2E24; --ink: #F4EBDD;
    --muted: #B6A48C; --line: #342920; --line-strong: #5E4D3D; --caramelo: #E2914A; --caramelo-ink: #F3B67D;
    --caramelo-soft: #3A2716; --accent: #E2914A; --on-accent: #1A120B; --vinho: #E58598; --vinho-soft: #3A1D24;
    --mata: #74C79C; --mata-soft: #18301F; --azul: #7FB6E0; --azul-soft: #172A39; --grafite: #C9C9C9;
    --grafite-soft: #2D2D2D; --ok: #74CE98; --ok-soft: #163222; --erro: #F08D76; --erro-soft: #3C1C15;
    --ambar: #E9C064; --ambar-soft: #362A10; --roxo: #B9A0E6; --roxo-soft: #2A2138;
    --hairline: 0 0 0 1px rgba(255, 236, 210, .06); --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.22);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

/* --- Base ------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 var(--font-body);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.sem-tabbar { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
a { color: var(--caramelo-ink); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: var(--fs-xl); font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 .8em; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[id] { scroll-margin-top: calc(64px + env(safe-area-inset-top)); }
.date-block b, .kpi b, .rk-val, .res-score, .scale button, .score-value, .bar-label b, .ring b { font-variant-numeric: tabular-nums lining-nums; }

.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.stack > *, .stack-lg > * { margin-block: 0; }
.stack > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-6); }
:is(.card, .empty, .list-row) > :last-child { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap-ok { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grow > :last-child { margin-bottom: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: var(--s-8) 0 var(--s-3); }
.section-title h2 { margin: 0; font-size: 1.15rem; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* Ícones SVG (sprite no base.html) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
     stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }

/* --- Topo ------------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; height: 52px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand b { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
main { padding-top: var(--s-3); }

/* Avatar (foto ou iniciais) */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; font-size: .88rem;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.avatar > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar.md { width: 38px; height: 38px; font-size: .82rem; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.xl { width: 140px; height: 140px; font-size: 2.6rem; margin: 0 auto; }
.avatar.off { background: var(--grafite); }
.avatar-edit { position: relative; overflow: visible; }
.avatar-edit > img { border-radius: 50%; }
.avatar-edit .cam { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow), var(--hairline); display: grid; place-items: center; }
.avatar-edit .cam .i { width: 16px; height: 16px; }

/* --- Barra inferior ------------------------------------------------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: 0 -1px 0 var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav { max-width: 620px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: var(--tabbar-h); padding: 0 4px; }
.tabbar a { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .01em; -webkit-touch-callout: none; }
.tabbar .ico { display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--r-pill);
  transition: background-color var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.tabbar .ico .i { width: 24px; height: 24px; stroke-width: 1.7; }
.tabbar a[aria-current] { color: var(--ink); }
.tabbar a[aria-current] .ico { background: var(--caramelo-soft); color: var(--caramelo-ink); }
.tabbar a[aria-current] .ico .i { stroke-width: 2.1; }
.tabbar a:active .ico { transform: scale(.92); }
.tab-avatar { width: 26px; height: 26px; font-size: .62rem; }
.tabbar a[aria-current] .tab-avatar { box-shadow: 0 0 0 2px var(--caramelo-soft), 0 0 0 3.5px var(--caramelo); }
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--erro); color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--surface); }

/* --- Cabeçalho de página e voltar ------------------------------------------------------------- */
.hello, .page-head { margin: var(--s-2) 0 var(--s-5); }
.hello h1, .page-head h1 { margin: 0; font-size: var(--fs-2xl); letter-spacing: -.02em; }
.hello p, .page-head .lede { color: var(--muted); margin: var(--s-1) 0 0; max-width: 42ch; }
.hello .eyebrow { margin: 0 0 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: calc(-1 * var(--s-2)) 0 0 -6px;
  padding-right: var(--s-2); color: var(--caramelo-ink); font-weight: 600; font-size: .95rem; text-decoration: none; }
.back .i { width: 22px; height: 22px; stroke-width: 2.2; }
.home-hello { margin: var(--s-1) 0 var(--s-4); }
.home-hello h1 { font-size: 1.9rem; }

/* --- Superfícies: cartões e listas ------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow), var(--hairline); }
.card.flat { box-shadow: var(--hairline); border: 0; }
.card.soft { background: var(--surface-2); box-shadow: none; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform var(--t-fast) var(--ease); }
a.card.list-row { display: flex; }
a.card:active { transform: scale(.99); }

.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow), var(--hairline); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; position: relative;
  text-decoration: none; color: inherit; transition: background-color var(--t-fast) var(--ease); }
.list-row + .list-row, .list > form + .list-row, .list > .list-row + form, .list > form + form { border-top: 1px solid var(--line); }
a.list-row:active, button.list-row:active { background: var(--surface-2); }
button.list-row { width: 100%; margin: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.list-row .grow b, .list-row .grow strong { display: block; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.list-row .grow small { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.list-row .em, .vote-item .em { width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); background: var(--surface-2);
  display: grid; place-items: center; font-size: 1.15rem; }
.list-row .chev { color: var(--muted); font-size: 1.4rem; line-height: 1; opacity: .6; }
.list-row.danger b, .list-row.danger { color: var(--erro); }
.list-row.stripe::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cat, var(--caramelo)); }
.list-row form, .list > form { margin: 0; }
.settings-title, .list-head { display: block; margin: var(--s-8) var(--s-1) var(--s-2);
  font: 700 .78rem/1.3 var(--font-body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.hello + .list-head, .hello + .settings-title, .view-switch + .list-head, .year-tabs + .list-head { margin-top: var(--s-5); }
.list-end { margin-top: var(--s-6); }
details.card > .list { margin: var(--s-3) calc(-1 * var(--s-5)) calc(-1 * var(--s-5)); box-shadow: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg); border-top: 1px solid var(--line); }

.event-card { position: relative; overflow: hidden; padding-left: 22px; }
.event-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat, var(--caramelo)); }
.event-card .meta { color: var(--muted); font-size: .9rem; }
.event-card .title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; line-height: 1.2; margin: 2px 0 6px; overflow-wrap: anywhere; }
.cat-vinho { --cat: var(--vinho); --cat-soft: var(--vinho-soft); }
.cat-mata { --cat: var(--mata); --cat-soft: var(--mata-soft); }
.cat-caramelo { --cat: var(--caramelo); --cat-soft: var(--caramelo-soft); }
.cat-azul { --cat: var(--azul); --cat-soft: var(--azul-soft); }
.cat-grafite { --cat: var(--grafite); --cat-soft: var(--grafite-soft); }
.cat-ouro { --cat: var(--ambar); --cat-soft: var(--ambar-soft); }
.cat-roxo { --cat: var(--roxo); --cat-soft: var(--roxo-soft); }
.cat-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--cat, var(--caramelo-ink)); background: var(--cat-soft, var(--caramelo-soft)); padding: 4px 10px; border-radius: var(--r-pill); }

/* Selos */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; line-height: 1.2;
  padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok, .chip.vou { background: var(--ok-soft); color: var(--ok); }
.chip.erro { background: var(--erro-soft); color: var(--erro); }
.chip.aberta, .chip.pendente, .chip.novo { background: var(--caramelo-soft); color: var(--caramelo-ink); }
.chip.avaliou, .chip.encerrada { background: var(--ok-soft); color: var(--ok); }
.chip.organizador, .chip.agendado { background: var(--azul-soft); color: var(--azul); }
.chip.cancelada, .chip.nao_foi, .chip.rascunho, .chip.adiado { background: var(--grafite-soft); color: var(--grafite); }

/* --- Botões ------------------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px; border-radius: var(--r-md); border: 0;
  font: 700 1rem/1.2 var(--font-body); letter-spacing: .005em; text-decoration: none; cursor: pointer; text-align: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), filter var(--t) var(--ease), background-color var(--t) var(--ease);
}
.btn .i { width: 20px; height: 20px; stroke-width: 2; }
.btn:active { transform: scale(.98); filter: brightness(.95); }
@media (hover: hover) { .btn:hover { filter: brightness(1.06); } }
.btn:focus-visible, .scale button:focus-visible, .seg label:focus-within, .seg a:focus-visible, .seg button:focus-visible,
.tabbar a:focus-visible, .list-row:focus-visible { outline: 3px solid color-mix(in srgb, var(--caramelo) 55%, transparent); outline-offset: 2px; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.soft { background: var(--caramelo-soft); color: var(--caramelo-ink); box-shadow: none; }
.btn.dark { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.danger { background: var(--erro-soft); color: var(--erro); box-shadow: none; }
.btn.whats { background: #15803D; color: #fff; box-shadow: none; }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: .94rem; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--caramelo-ink); text-decoration: underline; cursor: pointer; }
.danger-text { color: var(--erro) !important; }

/* Controle segmentado (Vou / Não vou, tema, visões) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); }
.seg button, .seg label, .seg a {
  min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-decoration: none;
  font: 700 .95rem/1.1 var(--font-body); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0; padding: 6px 8px; text-align: center; transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .on, .seg a[aria-current], .seg input:checked + span, .seg label:has(input:checked) { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm), var(--hairline); }
.seg .on.vou { color: var(--ok); }
.seg.big button { min-height: 56px; font-size: 1.05rem; }

/* --- Formulários -------------------------------------------------------------------------------- */
label, .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.hint { font-size: .86rem; color: var(--muted); margin-top: 5px; margin-bottom: 0; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=number],
input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: 1.05rem/1.4 var(--font-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 13px 14px; min-height: 52px;
  appearance: none; -webkit-appearance: none; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--caramelo); box-shadow: 0 0 0 4px color-mix(in srgb, var(--caramelo) 22%, transparent);
}
::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { min-height: 120px; resize: vertical; }
.field + .field { margin-top: var(--s-4); }
.field.has-error input, .field.has-error textarea { border-color: var(--erro); }
.error-text { color: var(--erro); font-size: .9rem; font-weight: 600; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-weight: 600; cursor: pointer; min-height: 52px; margin: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--caramelo); flex: none; }
.check:has(input:checked) { border-color: var(--caramelo); background: var(--caramelo-soft); }
.check-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }

/* --- Avisos -------------------------------------------------------------------------------------- */
.flash { border-radius: var(--r-md); padding: 12px 14px 12px 16px; font-weight: 600; font-size: .95rem; margin-bottom: var(--s-3);
  display: flex; gap: 10px; align-items: flex-start; box-shadow: inset 3px 0 0 currentColor; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.erro { background: var(--erro-soft); color: var(--erro); }
.flash.info { background: var(--azul-soft); color: var(--azul); }

/* Destaque quente (tela de agradecimento) */
.callout { border-radius: var(--r-xl); padding: var(--s-6); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #E9A15A 0%, #B8661F 48%, #7A410F 100%); box-shadow: var(--shadow-lg); }
.callout h2 { color: #fff; }
.callout .btn { background: #fff; color: #7A410F; box-shadow: none; }
.callout .muted, .callout .eyebrow { color: rgba(255,255,255,.88); }

/* Bloco de data */
.date-block {
  width: 56px; flex: none; text-align: center; border-radius: var(--r-md); padding: 6px 0 7px;
  background: var(--cat-soft, var(--caramelo-soft)); color: var(--cat, var(--caramelo-ink));
}
.date-block b { display: block; font: 700 1.5rem/1 var(--font-display); }
.date-block small { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.date-block.lg { width: 68px; padding: 8px 0 9px; }
.date-block.lg b { font-size: 1.85rem; }

/* Cartão de evento (convite público) */
.next-card { padding: var(--s-5); }
.next-card .head { display: flex; gap: 14px; align-items: flex-start; }
.next-card .title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; margin: 6px 0 4px; overflow-wrap: anywhere; }
.next-card .meta { color: var(--muted); font-size: .92rem; }
.next-card .seg { margin-top: var(--s-4); }

/* Pilha de avatares / pessoas */
.avatars { display: flex; align-items: center; }
.avatars .avatar { width: 32px; height: 32px; font-size: .72rem; border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .more { margin-left: 8px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.people > span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: var(--r-pill); padding: 3px 10px 3px 3px; font-size: .86rem; font-weight: 600; }
.people .avatar { width: 26px; height: 26px; font-size: .62rem; }

/* Espera da aprovação */
.waiting { text-align: center; padding: 26px 8px 8px; }
.waiting .paws { font-size: 2.6rem; display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.waiting .paws span { animation: step 1.6s ease-in-out infinite; opacity: .25; }
.waiting .paws span:nth-child(2) { animation-delay: .4s; }
.waiting .paws span:nth-child(3) { animation-delay: .8s; }
@keyframes step { 0%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-6px); } }
.linkbox { font: .92rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); border-radius: var(--r-md); padding: 12px; overflow-wrap: anywhere; user-select: all; }

/* --- Página do evento --------------------------------------------------------------------------- */
.ev-head { margin: 0 0 var(--s-6); }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-3); }
.ev-title { display: flex; gap: var(--s-4); align-items: center; }
.ev-title h1 { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.meta-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: .95rem; }
.meta-list li { display: flex; gap: 10px; align-items: flex-start; }
.meta-list .i { width: 18px; height: 18px; margin-top: 3px; color: var(--cat, var(--caramelo)); }
.ev-desc { margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-8) 0 var(--s-3); }
.section-head h2 { margin: 0; font-size: var(--fs-xl); }
.section-head .count { font: 600 .95rem var(--font-body); color: var(--muted); margin-left: 6px; }
.admin-link { margin-top: var(--s-8); }

/* Avaliação */
.presence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.presence label { margin: 0; }
.presence input { position: absolute; opacity: 0; pointer-events: none; }
.presence span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; justify-content: center;
  min-height: 78px; border-radius: var(--r-lg); border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow), var(--hairline);
  font-weight: 700; cursor: pointer; text-align: center;
}
.presence span em { font-style: normal; font-size: 1.6rem; line-height: 1; }
.presence input:checked + span { border-color: var(--caramelo); background: var(--caramelo-soft); color: var(--caramelo-ink); }
.presence input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--caramelo) 55%, transparent); }

.score-card { padding: var(--s-4); }
.score-card.has-error { box-shadow: 0 0 0 2px var(--erro), var(--shadow); }
.score-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.score-head .num { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.score-head h3 { margin: 0; flex: 1; min-width: 0; font-size: 1.08rem; }
.score-head input.score-value {
  width: 76px; flex: none; text-align: center; font: 700 1.5rem/1 var(--font-display);
  padding: 8px 4px; min-height: 52px; border-radius: var(--r-md); color: var(--caramelo-ink); background: var(--surface-2); border-color: transparent;
}
.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.scale button {
  min-height: 50px; border-radius: var(--r-md); border: 0; background: var(--surface-2);
  font: 700 1.12rem/1 var(--font-body); color: var(--ink); cursor: pointer; padding: 0;
  transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease);
}
.scale button[data-v="10"] { grid-column: span 2; }
.scale button.on { color: #fff; background: var(--tone, var(--accent)); transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.score-mood { min-height: 1.4em; font-size: .92rem; color: var(--muted); margin-top: 10px; text-align: center; }
.fine { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.fine button { min-height: 44px; min-width: 64px; border-radius: 12px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font-weight: 700; font-size: .95rem; cursor: pointer; }

.sticky-submit {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 10;
  padding: 10px; margin: 18px -10px 0; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sem-tabbar .sticky-submit { bottom: calc(env(safe-area-inset-bottom) + 10px); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--caramelo); width: var(--p, 0%); transition: width .3s; }

/* Resultados do evento */
.big-score { display: flex; align-items: center; gap: 18px; }
.big-score h2 { margin: 0; }
.big-score p { margin: 4px 0 0; }
.ring {
  --v: 0; width: 104px; height: 104px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--cat, var(--caramelo)) calc(var(--v) * 1%), var(--surface-2) 0);
}
.ring > div { width: 90px; height: 90px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font: 700 2rem/1 var(--font-display); display: block; }
.ring small { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: var(--surface-2); border-radius: var(--r-md); }
.kpi { padding: 12px 6px; text-align: center; }
.kpi + .kpi { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--ink) 10%, transparent); }
.kpi b { display: block; font: 700 1.3rem/1.1 var(--font-display); }
.kpi span { font-size: .78rem; color: var(--muted); }
.bars { display: grid; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: .95rem; margin-bottom: 5px; }
.bar-label b { font-family: var(--font-display); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: var(--cat, var(--caramelo)); }
.quote { margin: 0; padding: 2px 0 2px var(--s-3); border-left: 3px solid var(--cat, var(--caramelo)); font-style: normal; }

/* --- Resultados e ranking -------------------------------------------------------------------------- */
.view-switch { margin-top: var(--s-1); }
.year-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-top: var(--s-3); }
.year-tabs::-webkit-scrollbar { display: none; }
.year-tabs a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--muted); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.year-tabs a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
.res-score { text-align: right; font: 700 1.35rem/1 var(--font-display); flex: none; color: var(--ink); min-width: 48px; }
.res-score small { display: block; font: 600 .72rem var(--font-body); color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }

.rk-tabs { display: flex; gap: var(--s-5); overflow-x: auto; margin: var(--s-4) -16px 0; padding: 0 16px;
  border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x proximity; }
.rk-tabs::-webkit-scrollbar { display: none; }
.rk-tabs:not(.ready) { display: none; }
.rk-tabs button { flex: none; scroll-snap-align: start; min-height: 44px; padding: 0 2px; margin-bottom: -1px; border: 0;
  border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; color: var(--muted);
  font: 700 .95rem var(--font-body); white-space: nowrap; cursor: pointer; }
.rk-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--caramelo); }
.rk-panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow), var(--hairline); padding: var(--s-5); margin-top: var(--s-4); }
.rk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--s-1); }
.rk-head h2 { margin: 0; font-size: 1.2rem; }
.podium { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 8px; margin: 10px 0 4px; }
.podium .step { text-align: center; text-decoration: none; color: inherit; min-width: 0; }
.podium .medal { font-size: 2rem; line-height: 1; }
.podium .name { font-weight: 700; font-size: .84rem; line-height: 1.2; margin: 6px 0; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.podium .block { border-radius: var(--r-md) var(--r-md) 6px 6px; color: var(--medal-ink); padding: 10px 4px;
  font: 700 1.15rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.podium .block small { display: block; font: 600 .72rem/1.2 var(--font-body); opacity: .75; }
.podium .p1 .block { background: linear-gradient(180deg, #F3D57A, var(--ouro)); min-height: 120px; }
.podium .p2 .block { background: linear-gradient(180deg, #E1E4E8, var(--prata)); min-height: 92px; }
.podium .p3 .block { background: linear-gradient(180deg, #EBBD92, var(--bronze)); min-height: 72px; }
.rk-list { list-style: none; margin: 14px 0 0; padding: 0; }
.rk-list li > a, .rk-list li > div { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.rk-list li:first-child > a, .rk-list li:first-child > div { border-top: 0; }
.rk-list .grow b { display: block; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.rk-list .grow small { color: var(--muted); font-size: .8rem; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.rk-pos, .rank-list .pos { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .82rem; background: var(--surface-2); color: var(--muted); }
.rk-pos.p1, .rank-list .pos.p1 { background: var(--ouro); color: var(--medal-ink); }
.rk-pos.p2, .rank-list .pos.p2 { background: var(--prata); color: var(--medal-ink); }
.rk-pos.p3, .rank-list .pos.p3 { background: var(--bronze); color: var(--medal-ink); }
.rk-bar { display: block; height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 7px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--cat, var(--caramelo)); }
.rk-val { text-align: right; font: 700 1.1rem/1.1 var(--font-display); flex: none; }
.rk-val small { display: block; font: 500 .72rem var(--font-body); color: var(--muted); }
.rk-list.collapsed .rk-extra { display: none; }
.rk-more-btn { margin-top: 10px; }
.rk-champs { margin-top: var(--s-4); }
.rk-champs summary { cursor: pointer; font-weight: 700; font-size: .92rem; min-height: 44px; display: flex; align-items: center; }
.champ-grid { display: grid; gap: 8px; }
.champ { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
a.champ { color: inherit; text-decoration: none; }
.champ .em { font-size: 1.5rem; }
.champ small { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* lista simples (eventos organizados no Perfil) */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rank-list li:first-child { border-top: 0; }
.rank-list .info { flex: 1; min-width: 0; }
.rank-list .info a, .rank-list .info b { color: var(--ink); font-weight: 700; text-decoration: none; display: block; line-height: 1.25; overflow-wrap: anywhere; }
.rank-list .info small { color: var(--muted); font-size: .82rem; }

/* Estados vazios e segredos */
.empty { text-align: center; padding: var(--s-8) var(--s-5); }
.empty .em, .secret .em { font-size: 2.6rem; line-height: 1; margin-bottom: var(--s-3); }
.empty h3 { font: 700 1.05rem/1.3 var(--font-body); margin: 0; }
.empty p { color: var(--muted); font-size: var(--fs-sm); margin: var(--s-1) auto 0; max-width: 34ch; }
.secret { text-align: center; padding: 36px 20px; }

/* --- Perfil ------------------------------------------------------------------------------------------ */
.profile-head { display: flex; align-items: center; gap: var(--s-4); margin: var(--s-2) 0 var(--s-5); }
.profile-head h1 { margin: 0; font-size: 1.45rem; }
.profile-head p { margin: 2px 0 0; color: var(--muted); }
.persona { display: flex; align-items: center; gap: 16px; }
.persona .em { font-size: 3rem; line-height: 1; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; font-size: .94rem; }
.cmp a { overflow-wrap: anywhere; }
.cmp .h { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.delta-up { color: var(--ok); } .delta-down { color: var(--erro); }

/* Disclosure */
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; min-height: 44px; margin-block: -10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform var(--t) var(--ease); }
details.card[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
details.card[open] > summary { margin-bottom: var(--s-2); }
details.card.danger-zone > summary { color: var(--erro); }

/* --- Admin ------------------------------------------------------------------------------------------- */
.admin-nav { display: flex; gap: var(--s-5); overflow-x: auto; margin: 0 -16px var(--s-2); padding: 0 16px;
  border-bottom: 1px solid var(--line); scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; font-size: .95rem; text-decoration: none; }
.admin-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--caramelo); }
.admin-nav a.new { color: var(--caramelo-ink); }
.admin-nav a .i { width: 18px; height: 18px; stroke-width: 2.2; }
.admin-nav .chip { padding: 1px 7px; font-size: .72rem; }
.copybox { width: 100%; font: .95rem/1.45 var(--font-body); background: var(--surface-2); border: 0; border-radius: var(--r-md); padding: 12px; min-height: 180px; white-space: pre-wrap; color: var(--ink); }
.vote-list { display: block; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow), var(--hairline); overflow: hidden; }
.vote-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; min-width: 0; background: none; }
.vote-item + .vote-item { border-top: 1px solid var(--line); }
a.vote-item { color: inherit; text-decoration: none; }
a.vote-item:active { background: var(--surface-2); }
.card .vote-list { margin-inline: calc(-1 * var(--s-5)); background: none; box-shadow: none; border-radius: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vote-item .who { flex: 1; min-width: 0; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.vote-item .who small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.vote-item .vals { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.vote-item .vals span { min-width: 30px; text-align: center; font-weight: 700; font-size: .85rem; padding: 3px 5px; border-radius: 8px; background: var(--surface-2); }
.wa-row { border-radius: var(--r-lg); padding: 12px; background: var(--surface); box-shadow: var(--shadow), var(--hairline); }
.wa-row.off { opacity: .55; }
.wa-row pre { white-space: pre-wrap; font: .85rem/1.4 var(--font-body); background: var(--surface-2); padding: 8px 10px; border-radius: var(--r-sm); margin: 8px 0; max-height: 140px; overflow: auto; }
.mini-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; }
.mini-scores > div { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; }
.mini-scores label { font-size: .72rem; font-weight: 600; color: var(--muted); margin: 0; line-height: 1.15; }
.mini-scores input { min-height: 44px; padding: 8px; text-align: center; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table.simple { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.simple th, table.simple td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }

/* --- Premiação (modo apresentação) -------------------------------------------------------------------- */
body.show { background: #120D09; color: #F7EEDF; padding: 0; overflow: hidden; }
.slides { height: 100vh; height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; cursor: pointer; user-select: none; }
.slide { display: none; max-width: 900px; animation: rise .6s ease both; }
.slide.on { display: block; }
.slide h1 { font-size: clamp(2rem, 8vw, 4.4rem); color: #F7EEDF; }
.slide h2 { font-size: clamp(1.4rem, 5vw, 2.6rem); color: #F2B47A; }
.slide .em { font-size: clamp(3.5rem, 16vw, 8rem); line-height: 1; margin-bottom: 12px; }
.slide .sub { font-size: clamp(1rem, 3.6vw, 1.5rem); color: #C9B79E; }
.slide .score { font: 800 clamp(2rem, 9vw, 4.5rem)/1 var(--font-display); color: #E8BC3C; margin-top: 14px; }
.show-hint { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .8rem; color: #8A7A64; }
.show-exit { position: fixed; top: 12px; right: 14px; color: #8A7A64; font-size: .85rem; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* Confete de patinhas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.thanks { text-align: center; padding-top: 10px; }
.thanks .em { font-size: 4.2rem; line-height: 1; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

.footer { text-align: center; color: var(--muted); font-size: .78rem; margin: 36px 0 10px; }

/* --- Boas-vindas e códigos de acesso ------------------------------------------------------------------- */
.sem-topo .topbar { display: none; }
.sem-topo main { padding-top: calc(env(safe-area-inset-top) + 28px); }
.welcome { text-align: center; padding: 22px 8px 18px; }
.welcome-logo { width: 96px; height: 96px; display: block; margin: 0 auto 12px; }
.welcome h1 { font-size: 2.1rem; margin: 0; }
.welcome-sub { color: var(--muted); margin: 6px auto 0; max-width: 30ch; }
.code-big { font: 800 2.4rem/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; color: var(--caramelo-ink); user-select: all; }
input.code-input { font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .18em; text-align: center; }

/* Conta de administração vendo o app como um sócio vê */
.viewas-bar { background: var(--ink); color: var(--bg); font-size: .86rem; padding-top: env(safe-area-inset-top); }
.viewas-bar + .topbar { padding-top: 0; }
.viewas-bar .wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.viewas-bar form { margin: 0 0 0 auto; }
.viewas-bar button { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: var(--r-pill); padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; }

/* --- Início: carrossel de fotos ---------------------------------------------------------------------- */
.reel { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #120d09; box-shadow: var(--shadow-lg); isolation: isolate;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reel.quick .reel-slide { transition-duration: .5s; }
.reel-hint { text-align: center; color: var(--muted); font-size: .85rem; margin: var(--s-3) auto 0; max-width: 40ch; }
.reel-hint + .reel-hint { margin-top: var(--s-1); }
.home-empty .home-empty-how { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: .9rem; }
.reel-stage { position: relative; aspect-ratio: 4 / 5; width: 100%; overflow: hidden; min-height: 300px;
  max-height: calc(100vh - 250px);
  max-height: calc(100svh - 250px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
@media (max-width: 619.98px) { .reel { margin-inline: -16px; border-radius: 0; box-shadow: none; } }
.reel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease-in-out; }
.reel-slide.on { opacity: 1; }
.reel-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(28px) saturate(1.3) brightness(.6); transform: scale(1.1); }
.reel-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform; }
.reel-slide.fill .reel-img { object-fit: cover; }
.reel-slide.anim .reel-img { animation: kenburns var(--dur, 10s) ease-in-out forwards; }
.reel-slide.anim.alt .reel-img { animation-name: kenburns-alt; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.09) translate(-1.5%, -1%); } }
@keyframes kenburns-alt { from { transform: scale(1.09) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
.reel.paused .reel-slide.anim .reel-img, .reel.paused .reel-progress span { animation-play-state: paused; }
.reel-paused { position: absolute; top: 12px; right: 12px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center;
  color: #fff; background: rgba(0,0,0,.45); border-radius: 50%; font-size: .75rem; opacity: 0; transition: opacity .2s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.reel.paused .reel-paused { opacity: 1; }
.reel-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 72px 20px 26px; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.78) 100%); transition: opacity .5s; }
.reel-caption.swap { opacity: 0; }
.reel-legend { display: block; font-size: 1rem; line-height: 1.35; margin-bottom: 8px; opacity: .95; max-width: 34ch; }
.reel-legend:empty { display: none; }
.reel-caption b { display: block; font: 600 1.3rem/1.15 var(--font-display); letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.4); overflow-wrap: anywhere; }
.reel-caption small { display: block; margin-top: 4px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.reel-progress { position: absolute; left: 20px; right: 20px; bottom: 12px; height: 2px; z-index: 3; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.22); }
.reel-progress span { display: block; height: 100%; width: 100%; background: rgba(255,255,255,.85); transform-origin: left; transform: scaleX(0); }
.reel-progress span.run { animation: reelbar var(--show, 7s) linear forwards; }
@keyframes reelbar { to { transform: scaleX(1); } }
/* Início sem fotos ainda: cartão leve com "polaroides" */
.home-empty { text-align: center; padding: var(--s-10) var(--s-6) var(--s-8); border-radius: var(--r-xl);
  background: radial-gradient(130% 90% at 50% 0%, var(--caramelo-soft) 0%, var(--surface) 72%);
  box-shadow: var(--shadow), var(--hairline); }
.home-empty h2 { font-size: 1.35rem; margin: var(--s-6) auto var(--s-2); max-width: 22ch; }
.home-empty p { color: var(--muted); margin: 0 auto; max-width: 32ch; }
.polaroids { display: flex; justify-content: center; padding-top: var(--s-2); }
.polaroids span { width: 84px; height: 100px; flex: none; display: grid; place-items: center; padding-bottom: 14px;
  font-size: 2rem; border-radius: 10px; background: var(--surface); border: 6px solid var(--surface);
  box-shadow: 0 6px 18px rgba(60, 40, 15, .14), var(--hairline); background-clip: padding-box;
  background-image: linear-gradient(var(--surface-2), var(--surface-2)); background-size: 100% 70%; background-repeat: no-repeat; }
.polaroids span:nth-child(1) { transform: rotate(-9deg) translate(14px, 6px); }
.polaroids span:nth-child(2) { transform: translateY(-6px); z-index: 1; }
.polaroids span:nth-child(3) { transform: rotate(9deg) translate(-14px, 6px); }

/* --- Fotos: grade, envio e visualização ---------------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: var(--r-md); overflow: hidden; }
.photo-grid a { display: block; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-slow) var(--ease); }
.photo-grid a:active img { transform: scale(1.04); }
.photo-grid:has(> a:nth-child(5)) > a:first-child { grid-column: span 2; grid-row: span 2; }
.photo-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); cursor: pointer; text-align: center; font-weight: 400; margin: 0; }
.photo-pick .em { font-size: 2rem; }
.photo-pick b { font-weight: 700; }
.photo-pick small { color: var(--muted); }
.photo-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.photo-previews:empty { display: none; }
.photo-previews .pv { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.photo-previews img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-previews .pv::after { content: attr(data-state); position: absolute; inset: auto 0 0 0; font-size: .72rem; text-align: center; color: #fff; background: rgba(0,0,0,.5); padding: 2px; }
.photo-previews .pv[data-state=""]::after { display: none; }
.photo-view { margin: 0; text-align: center; }
.photo-view img { max-width: 100%; max-height: 74vh; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); background: var(--surface-2); }
.photo-view figcaption { margin-top: var(--s-3); }
.photo-caption { margin: 0 0 4px; font-size: 1.05rem; }

/* Foto de perfil: recorte */
.crop-box { width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden; touch-action: none; cursor: grab; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--caramelo); }
.crop-box canvas { width: 100%; height: 100%; display: block; }
.crop-zoom { display: flex; align-items: center; gap: 12px; font-weight: 800; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--caramelo); }

/* Instalar */
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 6px 0; }

/* Tipo de evento: ícone */
.emoji-input { width: 72px !important; flex: none; text-align: center; font-size: 1.6rem !important; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-top: 10px; }
.emoji-grid button { font-size: 1.45rem; min-height: 44px; border: 0; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.emoji-grid button.on { background: var(--caramelo-soft); box-shadow: inset 0 0 0 2px var(--caramelo); }

/* --- Ajustes finais ------------------------------------------------------------------------------------- */
@media (min-width: 420px) {
  .scale { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
  .scale button[data-v="10"] { grid-column: auto; }
  .scale button { font-size: 1rem; min-height: 48px; }
}
@media (display-mode: standalone) {
  [data-hide-standalone] { display: none !important; }
}
/* Transição suave entre telas (Chrome 126+, Safari 18.2+; os demais ignoram) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; animation-timing-function: var(--ease); }
.tabbar { view-transition-name: tabbar; }
.topbar { view-transition-name: topbar; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
