/* Galeria Formigueiro · Encontrão Rubeus 2026.
   Layout e identidade seguem o protótipo do marketing: faixa da marca
   (logo | slogan) -> card de introdução -> barra de dias fixa -> painel da
   galeria; a arte do Encontrão fica repetida no fundo, sob um véu leve. */
:root {
  --header: #FFFFFF;
  --accent: #F8C41B; --on-accent: #014735;
  --red: #ED1C24; --yellow: #F8C41B; --blue: #1A61AE; --green: #014735; --mint: #2FA37A;
  --ink: #10231D; --ink-soft: #4A5B54;
  --bg: #FFFFFF; --veil: rgba(255, 255, 255, 0.1); --st-open: #0B7A55; --lead: #014735;
  --surface: #FFFFFF; --surface-2: #F6EFDD; --border: rgba(16, 35, 29, 0.13);
  --font-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--veil), var(--veil)), url("bg-encontrao.png");
  background-size: auto, clamp(520px, 80vw, 900px) auto;
  background-repeat: no-repeat, repeat;
  color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--header); }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- faixa da marca ---------- */
.band { background: var(--header); position: relative; padding-top: env(safe-area-inset-top, 0px); }
.band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--yellow) 0 25%, var(--red) 25% 50%, var(--blue) 50% 75%, var(--mint) 75% 100%); }
.brand-row { display: flex; align-items: center; justify-content: center; gap: 14px; padding-block: 18px 24px; }
.rubeus-logo { height: 30px; width: auto; flex: none; display: block; }
.bar { flex: none; width: 2px; align-self: stretch; min-height: 44px; background: rgba(1, 71, 53, 0.28); border-radius: 2px; }
.slogan-art { display: block; height: 80px; width: auto; max-width: 100%; min-width: 0; flex: 0 1 auto; }

/* ---------- introdução ---------- */
.intro { background: var(--surface); border-radius: 24px; padding: 22px 20px 20px; margin-top: 18px; border: 1px solid var(--border);
  box-shadow: 0 10px 30px -14px rgba(1, 40, 30, 0.35); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--green); font-weight: 700; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; padding: 6px 11px; border-radius: 99px; }
.intro h1 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.05; letter-spacing: .2px; margin: 14px 0 6px; text-wrap: balance; color: var(--ink); }
.intro h1 em { font-style: normal; color: var(--red); }
.intro .lead { font-family: var(--font-display); font-size: 23px; line-height: 1.1; color: var(--lead); margin: 0 0 14px; }
.intro p { margin: 0 0 10px; max-width: 60ch; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 14px; padding: 13px 18px; font-size: 14.5px; font-weight: 600; line-height: 1.2; text-decoration: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary.done { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); flex: none; box-shadow: 0 0 0 4px rgba(47, 163, 122, 0.2); }

/* ---------- barra de dias ---------- */
.daybar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; margin-top: 18px; padding-block: 6px; }
.dayplate { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 0 6px; box-shadow: 0 10px 24px -14px rgba(1, 40, 30, 0.45); }
.daytabs { display: flex; gap: 4px; overflow-x: auto; padding: 12px 2px; scrollbar-width: none; min-height: 84px; }
.daytabs::-webkit-scrollbar { display: none; }
.daytab { flex: 1 1 0; min-width: 46px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 7px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); position: relative; }
.daytab .dow { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-soft); }
.daytab .num { font-family: var(--font-display); font-size: 23px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.daytab .st { font-size: 8.5px; letter-spacing: -0.1px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.daytab.locked { background: var(--surface-2); border-style: dashed; }
.daytab.locked .num { color: var(--ink-soft); }
.daytab.open .st { color: var(--st-open); font-weight: 700; }
.daytab.active { background: var(--accent); border-color: var(--green); border-style: solid; }
.daytab.active .dow, .daytab.active .num, .daytab.active .st { color: var(--on-accent); }
.daytab .star { position: absolute; top: -10px; right: -3px; width: 15px; line-height: 0; }
.daytab .star img { width: 100%; height: auto; display: block; image-rendering: pixelated; }

/* ---------- painel da galeria ---------- */
.panel { background: var(--surface); border-radius: 22px; padding: 14px; margin-top: 14px; border: 1px solid var(--border); box-shadow: 0 10px 30px -16px rgba(1, 40, 30, 0.35); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.segmented { display: flex; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 13px; padding: 3px; gap: 2px; }
.segmented button { border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 7px 12px; border-radius: 10px; display: flex; align-items: center; gap: 6px; }
.segmented button.active { background: var(--accent); color: var(--on-accent); }
.count { font-size: 10.5px; background: var(--yellow); color: var(--green); border-radius: 20px; padding: 1px 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.segmented button.active .count { background: var(--green); color: #fff; }
.daytitle { font-family: var(--font-display); font-weight: 400; font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: none; padding: 0; display: block; background: var(--surface-2); }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mine { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center; }
.mine svg { width: 11px; height: 11px; }
.play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.play i { width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.42); display: flex; align-items: center; justify-content: center; }
.play svg { width: 13px; height: 13px; fill: #fff; margin-left: 2px; }
.empty { grid-column: 1/-1; text-align: center; padding: 42px 18px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--ink); }
.note { font-size: 11.5px; color: var(--ink-soft); margin: 12px 2px 0; text-align: center; }

/* em breve */
.soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 14px 18px; }
.soon .ant { width: 68px; height: auto; image-rendering: pixelated; display: block; }
.soon h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; margin: 6px 0 0; color: var(--red); }
.soon p { margin: 0 0 12px; max-width: 34ch; color: var(--ink-soft); }
.soon-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; margin-bottom: 16px; }
.soon-slots i { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); border: 1.5px dashed var(--border); }
@media (min-width: 520px) { .soon-slots { grid-template-columns: repeat(4, 1fr); } }

.loading { display: flex; justify-content: center; padding: 40px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { padding-top: 18px; padding-bottom: 40px; text-align: center; font-size: 12px; color: var(--ink-soft); }
.foot p { display: inline-block; margin: 0; background: rgba(255, 255, 255, 0.85); padding: 6px 12px; border-radius: 20px; }
.foot b { color: var(--ink); }

/* ---------- folha da selfie ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6, 16, 12, 0.62); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto;
  padding: 20px max(20px, env(safe-area-inset-left, 0px)) max(22px, env(safe-area-inset-bottom, 0px)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .spinner { animation-duration: 2s; } }
.grab { width: 40px; height: 4px; background: var(--border); border-radius: 4px; margin: 0 auto 16px; }
.sheet h2 { font-family: var(--font-display); font-weight: 400; font-size: 25px; line-height: 1.1; margin: 0 0 6px; }
.sheet p.desc { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 16px; }
.steps { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; }
.step .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step span:last-child { padding-top: 3px; }
.selfie-frame { position: relative; width: 168px; height: 168px; border-radius: 50%; margin: 2px auto 8px; border: 3px dashed var(--border); display: flex; align-items: center; justify-content: center; background: var(--surface-2); overflow: hidden; color: var(--ink-soft); padding: 0; }
.selfie-frame > svg { width: 48px; height: 48px; }
.selfie-frame.live, .selfie-frame.filled { border-style: solid; border-color: var(--yellow); }
.selfie-frame video, .selfie-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.selfie-frame video { transform: scaleX(-1); }
.frame-hint { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 16px; min-height: 1.5em; }
.frame-hint.error { color: var(--red); font-weight: 600; }
.sheet .btn + .btn { margin-top: 8px; }
.fine { font-size: 11.5px; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: #FFFDF7; z-index: 60; display: flex; flex-direction: column; color: var(--ink); }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px)) 10px; }
.lb-top button { background: var(--surface-2); border: none; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lb-top button svg { width: 16px; height: 16px; }
.lb-spacer { width: 38px; }
.lb-tag { font-size: 12px; font-weight: 600; background: var(--surface-2); padding: 5px 11px; border-radius: 20px; }
.lb-media { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 12px; min-height: 0; }
.lb-media img, .lb-media video { max-width: 100%; max-height: 100%; border-radius: 16px; display: block; object-fit: contain; background: #000; }
.lb-media img { background: transparent; }
.lb-meta { color: var(--ink-soft); text-align: center; font-size: 12px; padding: 12px 20px 14px; }
.lb-actions { display: flex; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-bottom, 0px)); }
.lb-actions a, .lb-actions button { flex: 1; background: var(--surface-2); border: none; border-radius: 14px; padding: 13px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); text-decoration: none; font-family: inherit; }
.lb-actions a { background: var(--red); color: #fff; }
.lb-actions svg { width: 16px; height: 16px; }

.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 24px)); transform: translate(-50%, 14px); background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: 0 12px 28px -10px rgba(1, 40, 30, 0.4); padding: 11px 18px; border-radius: 30px; font-size: 13px; font-weight: 500; opacity: 0; transition: all .25s; z-index: 80; max-width: 88%; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) { .slogan-art { height: 68px; } .rubeus-logo { height: 26px; } .intro h1 { font-size: 28px; } }
@media (min-width: 560px) { .slogan-art { height: 96px; } .rubeus-logo { height: 36px; } .intro h1 { font-size: 38px; } .intro { padding: 26px 26px 24px; } }
