:root {
  --pink: #ff3d9a;
  --blue: #3d8bff;
  --purple: #a54dff;
  --bg: #06060a;
  --panel: #0d0d14;
  --text: #ffffff;
  --grad: linear-gradient(90deg, var(--blue), var(--purple), var(--pink));
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}
#app {
  width: 100%;
  max-width: 520px;
  min-height: 100%;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

.screen { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 10px; animation: fadein .25s ease; }
.boot-spinner { font-size: 64px; margin-top: 38vh; animation: pulse 1s ease-in-out infinite; }
.hidden { display: none !important; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- typography ---------- */
.logo { text-align: center; margin-top: 22px; }
.logo-line1 {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-line2 {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.12;
  margin-top: 6px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(255, 61, 154, .35);
}
.home-emoji { font-size: 84px; margin: 6px 0; filter: drop-shadow(0 6px 24px rgba(165, 77, 255, .45)); }
.home-tagline { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: #aab; }
.screen-title { font-family: "Arial Black", Arial, sans-serif; font-size: 24px; font-weight: 900; }
.fineprint { font-size: 12px; color: #667; text-align: center; max-width: 340px; }
.share-hint { font-size: 13px; color: #9aa; text-align: center; max-width: 360px; }
.share-hint em { color: #ccd; }
.upload-hint { font-size: 13px; color: #889; text-align: center; }
.attest {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #99a;
  max-width: 380px;
  cursor: pointer;
  text-align: left;
}
.attest input { margin-top: 2px; accent-color: var(--purple); }

/* ---------- buttons ---------- */
.btn {
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  max-width: 380px;
  transition: transform .08s ease, opacity .15s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 26px rgba(165, 77, 255, .45); }
.btn-primary-alt { background: #fff; color: #111; box-shadow: 0 4px 22px rgba(255, 255, 255, .18); }
.btn-ghost { background: transparent; color: #9aa; border: 1px solid #333; }

/* ---------- upload slots ---------- */
.upload-group { width: 100%; max-width: 420px; }
.group-label { font-size: 15px; letter-spacing: 2px; margin-bottom: 8px; font-weight: 800; }
.group-hint { color: #667; font-weight: 600; letter-spacing: 0; font-size: 12px; }
.label-baby { color: var(--pink); }
.label-dad { color: var(--blue); }
.label-mom { color: var(--purple); }
.slots { display: grid; gap: 10px; }
.slots-3 { grid-template-columns: repeat(3, 1fr); }
.slots-2 { grid-template-columns: repeat(2, 1fr); }
.slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px dashed #2a2a38;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.slot .plus { font-size: 30px; font-weight: 300; color: #555; pointer-events: none; }
[data-role="baby"] .slot { border-color: rgba(255, 61, 154, .45); }
[data-role="dad"] .slot { border-color: rgba(61, 139, 255, .45); }
[data-role="mom"] .slot { border-color: rgba(165, 77, 255, .45); }
.slot.filled { border-style: solid; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  border: 1px solid #555;
  font-size: 15px;
  line-height: 1;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ---------- canvas / collage ---------- */
.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
}
.canvas-wrap canvas { display: block; width: 100%; height: auto; }
.scanline {
  position: absolute;
  left: 0; right: 0;
  top: -12%;
  height: 12%;
  background: linear-gradient(to bottom, transparent, rgba(61, 139, 255, .30), rgba(255, 61, 154, .38), transparent);
  animation: scan 1.4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes scan { from { top: -12%; } to { top: 100%; } }
.analyzing-msg { font-size: 17px; font-weight: 700; color: #cfd6ff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- rewarded breakdown ---------- */
.breakdown {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid #1e1e2c;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: fadein .3s ease;
}
.breakdown-title { font-size: 16px; font-weight: 900; text-align: center; }
.bd-row { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.bd-feat { color: #cdd; font-weight: 600; }
.bd-who { font-weight: 900; letter-spacing: .5px; }
.breakdown-foot { text-align: center; font-size: 12px; color: #667; margin-top: 2px; }

/* ---------- ad units (web / Adsterra) ---------- */
.ad-banner {
  margin: 2px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-banner iframe { display: block; }
.ad-native { width: 100%; max-width: 420px; margin: 8px auto 0; }
.ad-native:empty { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #17171f;
  border: 1px solid #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  max-width: 90vw;
  text-align: center;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}
.modal-card {
  background: #12121a;
  border: 1px solid #2a2a38;
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.modal-card p { font-size: 13px; color: #9aa; }
.modal-card input {
  background: #0a0a10;
  border: 1px solid #333;
  border-radius: 10px;
  color: #cdf;
  padding: 12px;
  font-size: 13px;
  width: 100%;
}
