:root {
  --accent-color: #e0245e;
  --bg: #030712;
  --fg: #f5f5f7;
  --muted: #a1a1aa;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Deliberately NOT forced to fill the viewport (no 100vh/100dvh min-height,
   no flexbox centering on body): in-app WebViews and mobile Safari compute
   dvh/vh and flex-stretch inconsistently, which kept pushing real content
   way below the fold behind a huge dead gap. Plain margin:auto centering on
   a block element has no such ambiguity — the card is exactly as tall as
   its actual content (photo block + a compact text/button section) on
   every browser, full stop. */
.page {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Photo is a bounded block at the top (NOT a full-bleed background behind
   the whole page). No fixed aspect-ratio here on purpose: a single ratio
   shared by every creator forces object-fit:cover to re-crop whatever
   photo is uploaded, silently overriding the framing someone already
   chose. app.js sets aspect-ratio inline once the real image's natural
   dimensions are known, so the box always matches the uploaded photo
   exactly — zero surprise cropping, works for any future creator/photo. */
.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5; /* fallback only, before JS measures the real photo */
  flex-shrink: 0;
  overflow: hidden;
  background: #17171b;
}

.media-frame img,
.media-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  /* Hidden until real media actually loads (see app.js) — a missing/broken
     photo or video must never render as a broken-image icon; the block's
     own dark background shows through instead until then. */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-frame img.is-ready,
.media-frame video.is-ready {
  opacity: 1;
}

/* The video (when present) plays on top of the photo as an enhancement. */
.media-frame video {
  z-index: 1;
}

/* The gradual black fade at the bottom of the photo that blends into the
   solid black content section below it — not a full-image overlay. */
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(3,7,18,0) 55%, var(--bg) 100%);
}

.content {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 0 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.creator-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.badges {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  color: #fff;
}

.badge-online {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(34, 197, 94);
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.6s infinite;
}

.badge-city {
  background: rgba(255, 255, 255, 0.08);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.cta-button {
  margin-top: 4px;
  display: block;
  width: 100%;
  text-align: center;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
}

.manual-fallback-link[hidden] {
  display: none;
}

.manual-fallback-link {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
}
