/* ---------------------------------------------------------------------------
   Guest page. Mobile first, pt-BR only (D25), no framework, no CDN.
   --------------------------------------------------------------------------- */

@font-face { font-family: 'Caveat'; src: url('/fonts/Caveat-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --primary: #E5397B;
  --secondary: #F5B33C;
  --accent: #FFF4E6;
  --ink: #2B1B2E;
  --bg: #3B0D2A;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(43, 27, 46, 0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* The [hidden] attribute must win over the explicit display rules below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(170deg, var(--bg), #6b1240 60%, var(--bg));
  min-height: 100%;
  color: var(--ink);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 17px;
}

#app { padding: 0 14px 130px; max-width: 620px; margin: 0 auto; }

/* --- top bar ------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 16px 4px 10px; color: var(--accent);
}
.topbar .who { display: flex; flex-direction: column; }
.topbar strong { font-size: 1.15rem; }
.topbar .status { font-size: 0.85rem; opacity: 0.85; text-align: right; }
.link {
  background: none; border: 0; color: var(--secondary);
  font-size: 0.85rem; padding: 0; text-align: left; text-decoration: underline;
  cursor: pointer; font-family: inherit;
}

/* --- banners ------------------------------------------------------------- */

.banner {
  margin: 0 0 10px; padding: 12px 16px; border-radius: var(--radius);
  font-weight: 600; text-align: center; font-size: 0.98rem;
}
.banner.live { background: var(--secondary); color: var(--ink); animation: pulse 1.2s infinite; }
.banner.eta { background: var(--primary); color: #fff; }
.banner.wait { background: rgba(255,255,255,0.16); color: var(--accent); font-weight: 400; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.02);} }

/* --- live countdown (D46) ----------------------------------------------- */

.countdown {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(120deg, var(--primary), #ff6aa8);
  border-radius: var(--radius); padding: 14px 18px; margin: 0 0 10px;
  box-shadow: 0 12px 30px rgba(229, 57, 123, 0.35);
  animation: cd-pulse 1s ease-in-out infinite;
}
@keyframes cd-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.cd-ring {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.85);
  display: grid; place-items: center;
}
.cd-ring span { font-size: 1.9rem; font-weight: 700; color: #fff; line-height: 1; }
.cd-copy { display: grid; gap: 2px; }
.cd-copy strong { font-size: 1.05rem; color: #fff; }
.cd-sub { font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); }

/* Softer notice while the photo is still far away */
.countdown.soft { background: rgba(255, 255, 255, 0.16); animation: none; box-shadow: none; }
.countdown.soft .cd-ring { background: transparent; border-color: transparent; width: auto; height: auto; }
.countdown.soft .cd-copy strong { color: var(--accent); }
.countdown.soft .cd-sub { color: rgba(255, 244, 230, 0.75); }

/* --- tabs ---------------------------------------------------------------- */

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; background: rgba(255,255,255,0.12);
  padding: 6px; border-radius: 999px; margin: 0 0 14px;
}
.tab {
  border: 0; background: transparent; color: var(--accent);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 11px 6px; border-radius: 999px; cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- cards --------------------------------------------------------------- */

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.card h3 { margin: 4px 0 10px; font-size: 1.1rem; }
.card.mission { background: linear-gradient(140deg, var(--secondary), #ffd98a); }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; background: rgba(43,27,46,0.1); padding: 4px 10px; border-radius: 999px;
  margin-bottom: 8px;
}
.hint { font-size: 0.85rem; opacity: 0.65; margin: 10px 0 0; }
.notice { background: #ffe9c9; color: #7a4b00; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 14px; }
.error { color: #b00020; font-size: 0.9rem; margin: 10px 0 0; }
.sub { opacity: 0.75; font-size: 0.95rem; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  border: 0; border-radius: 14px; font-family: inherit; font-size: 1rem;
  font-weight: 600; padding: 14px 18px; cursor: pointer; width: 100%;
  transition: transform 120ms ease, opacity 120ms ease; text-align: center;
  display: block; text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: rgba(43,27,46,0.08); color: var(--ink); }
.btn.big { font-size: 1.08rem; padding: 17px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.actions { display: grid; gap: 10px; }
.actions.row { grid-template-columns: 1fr 1fr; margin-top: 12px; }

.field { display: block; margin: 0 0 12px; }
.field span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; opacity: 0.75; }
.field input, textarea {
  width: 100%; border: 2px solid rgba(43,27,46,0.14); border-radius: 12px;
  padding: 14px; font-family: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
.field input:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; }

/* --- preview ------------------------------------------------------------- */

#preview-media img, #preview-media video {
  width: 100%; border-radius: 12px; display: block; background: #000; max-height: 52vh; object-fit: contain;
}
.progress { height: 8px; background: rgba(43,27,46,0.12); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.progress .bar { height: 100%; width: 0%; background: var(--primary); transition: width 200ms ease; }

/* --- lists --------------------------------------------------------------- */

.list { display: grid; gap: 10px; }
.row-item {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center;
  background: rgba(43,27,46,0.04); border-radius: 12px; padding: 10px;
}
.row-item img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; background: #ddd; }
.row-item .meta strong { display: block; font-size: 0.95rem; }
.row-item .meta small { opacity: 0.6; font-size: 0.8rem; }
.pill { font-size: 0.72rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(43,27,46,0.1); }
.pill.ok { background: #d7f5dd; color: #14601f; }
.pill.wait { background: #ffe9c9; color: #7a4b00; }
.pill.bad { background: #ffd9de; color: #8b0018; }
.pill .flag { color: #8b0018; }
.thumb-flagged { position: relative; }
.thumb-flagged::after {
  content: ''; position: absolute; inset: 0; background: rgba(200, 0, 40, 0.42); border-radius: 8px;
}
.btn-mini { border: 0; background: rgba(43,27,46,0.08); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: 0.82rem; cursor: pointer; }

/* --- crowd heart (D75) --------------------------------------------------- */

.crowd-heart {
  position: relative; width: 190px; height: 170px; margin: 10px auto 4px;
  background: rgba(43,27,46,0.12);
  clip-path: path('M95 166 C 40 128, 6 96, 6 60 C 6 30, 28 12, 52 12 C 68 12, 84 22, 95 38 C 106 22, 122 12, 138 12 C 162 12, 184 30, 184 60 C 184 96, 150 128, 95 166 Z');
  overflow: hidden; display: grid; place-items: center;
}
.crowd-heart .fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: var(--primary); transition: height 300ms ease;
}
.crowd-heart span { position: relative; font-weight: 600; color: var(--ink); font-size: 1.4rem; }

/* --- heart fab (D63) ----------------------------------------------------- */

.heart-fab {
  position: fixed; right: 16px; bottom: 18px; z-index: 20;
  border: 0; border-radius: 999px; background: var(--primary); color: #fff;
  padding: 14px 20px; font-family: inherit; font-weight: 600; font-size: 1rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 8px;
  max-width: 70vw;
}
.heart-fab .h { font-size: 1.3rem; }
.heart-fab:active { transform: scale(0.94); }

#pop-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.pop-heart {
  position: fixed; font-size: 1.8rem; color: var(--primary);
  animation: pop-up 1100ms ease-out forwards;
}
@keyframes pop-up { 0% { opacity: 1; transform: translateY(0) scale(1);} 100% { opacity: 0; transform: translateY(-160px) scale(1.5);} }

/* --- modals -------------------------------------------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(20, 5, 15, 0.85);
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.modal-card {
  background: #fff; border-radius: 22px; padding: 26px; width: 100%; max-width: 460px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.modal-card.wide { max-width: 560px; }
.modal-card h1 { font-family: 'Caveat', cursive; font-size: 2.6rem; margin: 0 0 6px; color: var(--primary); }
.modal-card h2 { margin: 0 0 12px; }

/* --- booth (D73) -------------------------------------------------------- */

#booth-video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
.countdown {
  font-family: 'Caveat', cursive; font-size: 6rem; color: var(--primary);
  text-align: center; margin: -120px 0 60px; text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.strip { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.strip img { width: 74px; border-radius: 8px; border: 3px solid #fff; box-shadow: var(--shadow); }

/* --- misc --------------------------------------------------------------- */

#domino-ref { width: 100%; border-radius: 12px; display: block; background: #000; max-height: 300px; object-fit: contain; }
.icon-inline { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; }

@media (min-width: 620px) {
  #app { padding-bottom: 40px; }
  .actions.row { grid-template-columns: repeat(2, 1fr); }
}

/* confirmation after a send */
.banner.ok { background: #d9f5dd; color: #12521f; }

/* the host started an activity: the tab and the card show it (D78) */
.tab { position: relative; }
.tab-dot {
  position: absolute; top: 6px; right: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--secondary); box-shadow: 0 0 0 3px rgba(245, 179, 60, 0.35);
  animation: pulse 1.2s infinite;
}
.tag.now { background: var(--secondary); color: var(--ink); margin-right: 6px; }

/* the text card as the big screen draws it (D64) */
.bubble-preview {
  position: relative; margin: 14px 0 22px; padding: 18px 16px;
  background: var(--primary); color: #fff; border-radius: 18px; text-align: center;
}
.bubble-preview::after {
  content: ''; position: absolute; bottom: -18px; left: 14%;
  border: 10px solid transparent; border-top-color: var(--primary);
}
.bubble-preview p { margin: 0; font-size: 1.15rem; font-weight: 600; word-break: break-word; }
.bubble-preview small { display: block; margin-top: 6px; opacity: 0.9; }

/* install guide for the iPhone, with the two icons */
.ios-icon { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin: 0 2px; }
