/* =============================================================================
 * Novara Avatar Onboarding — full-screen first-run avatar step (namespaced .nvo)
 * Matches Novara CI: deep navy → purple ground, cyan #22d3ee / violet #a78bfa
 * accents, translucent glass cards. Self-contained; no Tailwind, no deps.
 * Reuses the app's shared .avatar-ring for the final preview.
 * ========================================================================== */
.nvo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  color: var(--nv-ink, #eef2ff);
  font-family: var(--nv-font-body, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif);
  /* the app ground (css/style.css body::before), slightly denser for a modal */
  background:
    radial-gradient(1100px 760px at 84% -10%, rgba(124, 58, 237, 0.30), transparent 56%),
    radial-gradient(900px 680px at 2% 4%, rgba(34, 211, 238, 0.15), transparent 52%),
    radial-gradient(760px 720px at 62% 112%, rgba(244, 114, 182, 0.10), transparent 55%),
    linear-gradient(165deg, #080b16, #140a2a 50%, #080b16);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.nvo * { box-sizing: border-box; }
.nvo {
  width: 100%;
  max-width: 560px;
  margin: auto;
}
.nvo-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  padding: 1.5rem;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.nvo-title {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
  background: linear-gradient(120deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nvo-sub { color: #cbd5e1; font-size: 0.95rem; margin: 0 0 1.25rem; line-height: 1.4; }

/* --- Two big choices ---------------------------------------------------- */
.nvo-choices { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 480px) { .nvo-choices { grid-template-columns: 1fr 1fr; } }
.nvo-choice {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 1.25rem;
  cursor: pointer;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.nvo-choice:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.6); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35); }
.nvo-choice-emoji { font-size: 2.1rem; line-height: 1; }
.nvo-choice-title { font-weight: 700; font-size: 1.02rem; }
.nvo-choice-desc { font-size: 0.82rem; color: #94a3b8; line-height: 1.3; }
.nvo-choice[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Buttons ------------------------------------------------------------ */
.nvo-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.25rem; }
.nvo-btn {
  /* = .nv-btn / .nv-btn-secondary (css/style.css): 16px radius, ≥44px, glass */
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--nv-r-tile, 16px);
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  font-weight: 700; font-size: 0.95rem;
  color: var(--nv-ink, #eef2ff); cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.nvo-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.14); }
.nvo-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
/* primary = the app's cyan button (dark text, cyan glow) */
.nvo-btn-primary, .nvo-btn-cyan {
  border-color: transparent; color: #04121a;
  background: linear-gradient(120deg, var(--nv-cyan, #22d3ee), var(--nv-cyan-soft, #67e8f9));
  box-shadow: 0 12px 30px -10px rgba(34, 211, 238, 0.5);
}
.nvo-btn-primary:hover, .nvo-btn-cyan:hover { box-shadow: 0 16px 40px -10px rgba(34, 211, 238, 0.6); }
.nvo-btn-ghost { background: transparent; color: #cbd5e1; }
.nvo-spacer { flex: 1 1 auto; }

/* --- Consent panel ------------------------------------------------------ */
.nvo-consent-copy {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  font-size: 0.9rem; line-height: 1.5; color: #e2e8f0;
  margin-bottom: 1rem;
}
.nvo-consent-copy ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.nvo-consent-copy li { margin: 0.2rem 0; }
.nvo-consent-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; color: #e2e8f0; cursor: pointer; }
.nvo-consent-check input { margin-top: 0.15rem; width: 18px; height: 18px; accent-color: #22d3ee; flex: 0 0 auto; }

/* --- Capture / preview stage ------------------------------------------- */
.nvo-stage {
  display: grid; place-items: center;
  min-height: 260px;
  border-radius: 1.25rem;
  background: radial-gradient(120% 120% at 50% 15%, rgba(34, 211, 238, 0.12), rgba(167, 139, 250, 0.1) 55%, transparent 72%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 1rem;
}
.nvo-stage video, .nvo-stage img.nvo-shot {
  width: 100%; max-height: 340px; object-fit: cover; display: block;
}
/* Camera switch. Hidden unless the device reports more than one video input,
   so a laptop with a single webcam never shows a button that does nothing. */
.nvo-flip[hidden] { display: none; }
.nvo-flip { flex: none; }

.nvo-preview-ring { --sz: 168px; }
.nvo-preview-ring .avatar-ring { width: var(--sz); height: var(--sz); }
.nvo-hint { font-size: 0.82rem; color: #94a3b8; margin: 0 0 1rem; line-height: 1.4; }
.nvo-error { color: #fca5a5; font-size: 0.88rem; margin: 0.25rem 0 0.75rem; }

/* --- AI wait: Mark's story + filling progress bar (no spinner, no emoji) - */
.nvo-wait { text-align: left; }
.nvo-wait-story {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.5rem 1.4rem;
  margin-bottom: 1.5rem;
}
.nvo-wait-head {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
  color: #f8fafc;
}
.nvo-grad {
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nvo-wait-body { color: #cbd5e1; font-size: 0.98rem; line-height: 1.55; margin: 0 0 0.9rem; }
.nvo-wait-sign {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700; font-size: 1.02rem; color: #e2e8f0; margin: 0;
}
.nvo-bar-label { font-size: 0.82rem; color: #94a3b8; margin: 0 0 0.55rem; }
.nvo-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.nvo-bar-fill {
  height: 100%;
  width: 6%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.nvo-cap-note { font-size: 0.8rem; color: #94a3b8; margin-top: 0.75rem; }
.nvo-file-input { display: none; }

/* --- "This is you!" reveal card ----------------------------------------- */
/* A premium, self-contained card: big avatar on a dark cyan→violet gradient
   inside a rounded glass frame, the name in the Bricolage display face and a
   short descriptor below. Works standalone (no .nvo ancestor required) so the
   same classes render the compact version embedded in Einstellungen. */
.nvo-reveal { text-align: center; }
.nvo-reveal-card {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
  padding: 1.9rem 1.5rem 1.75rem;
  border-radius: 1.75rem;
  color: #f8fafc;
  background:
    radial-gradient(130% 80% at 50% -5%, rgba(34, 211, 238, 0.22), transparent 60%),
    radial-gradient(130% 120% at 50% 115%, rgba(167, 139, 250, 0.26), transparent 62%),
    linear-gradient(165deg, #0b1022, #1e123f 55%, #0b1022);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  animation: nvo-reveal-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* soft top sheen */
.nvo-reveal-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(90% 55% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 70%);
  pointer-events: none;
}
.nvo-reveal-inner { position: relative; z-index: 1; }
.nvo-reveal-badge {
  display: inline-block;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: #06202a;
  padding: 0.28rem 0.8rem; border-radius: 999px; margin-bottom: 1.1rem;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.35);
}
.nvo-reveal-avatar {
  --sz: 200px;
  width: var(--sz); height: var(--sz);
  margin: 0 auto 1.15rem;
  display: grid; place-items: center;
}
.nvo-reveal-avatar .avatar-ring,
.nvo-reveal-avatar .nova-avatar {
  width: var(--sz) !important; height: var(--sz) !important;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.55), 0 0 42px rgba(34, 211, 238, 0.45), 0 0 70px rgba(167, 139, 250, 0.4);
}
.nvo-reveal-avatar .nvo-face-emoji { font-size: calc(var(--sz) * 0.6); line-height: 1; }
.nvo-reveal-name {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800; font-size: 1.9rem; line-height: 1.1; margin: 0 0 0.3rem;
  background: linear-gradient(120deg, #67e8f9, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-word;
}
.nvo-reveal-desc { color: #cbd5e1; font-size: 0.95rem; line-height: 1.4; margin: 0; }

@keyframes nvo-reveal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

.nvo-actions-center { justify-content: center; }
.nvo-btn-block { width: 100%; justify-content: center; text-align: center; }

/* --- Compact reveal card (Einstellungen "Your avatar" block) ------------ */
.nvo-reveal-embed { max-width: 100%; }
.nvo-reveal-compact { padding: 1.4rem 1.25rem 1.3rem; max-width: 100%; border-radius: 1.35rem; }
/* Settings card: the avatar IS the content here - the badge and descriptor
   were removed, so it gets the space they used. Scales with the card on
   narrow screens instead of a fixed 128px. */
.nvo-reveal-compact .nvo-reveal-avatar { --sz: min(300px, 62vw); margin-bottom: 0.4rem; }
.nvo-reveal-compact .nvo-reveal-badge { margin-bottom: 0.8rem; font-size: 0.66rem; }
.nvo-reveal-compact .nvo-reveal-name { font-size: 1.45rem; }
.nvo-reveal-compact .nvo-reveal-desc { font-size: 0.88rem; }
.nvo-reveal-compact .nvo-actions { margin-top: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .nvo-choice, .nvo-btn { transition: none; }
  .nvo-bar-fill { transition: none !important; }
  .nvo-reveal-card { animation: none; }
}

/* Guest mode: "Account needed" hint on the photo tile, so the sign-up sheet is
   announced before the tap rather than sprung after it. */
.nvo-choice-note {
  display: block; margin-top: 4px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: #fbbf24; opacity: .95;
}

/* ── Tap-to-enlarge ─────────────────────────────────────────────────────────
   The avatar is worth looking at properly: the preview, the reveal and the
   settings card all open a full-screen view on tap. */
.nvo-preview-ring.is-zoomable,
.nvo-reveal-avatar.is-zoomable { cursor: zoom-in; }
.nvo-preview-ring.is-zoomable img,
.nvo-reveal-avatar.is-zoomable img { transition: transform .18s ease; }
.nvo-preview-ring.is-zoomable:hover img,
.nvo-reveal-avatar.is-zoomable:hover img { transform: scale(1.03); }

.nv-avlb {
  position: fixed; inset: 0; z-index: 10100;
  display: flex; align-items: center; justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 6, 14, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  cursor: zoom-out;
  animation: nv-avlb-in .16s ease-out;
}
@keyframes nv-avlb-in { from { opacity: 0 } to { opacity: 1 } }
.nv-avlb-img {
  max-width: min(92vw, 560px); max-height: 78vh;
  width: auto; height: auto;
  border-radius: 24px;
  background: #141a33;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 3px rgba(103, 232, 249, .35);
  image-rendering: -webkit-optimize-contrast;
}
.nv-avlb-close {
  position: absolute; top: max(14px, env(safe-area-inset-top, 0px)); right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(15, 20, 38, .8); color: #e2e8f0;
  font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Name field on the reveal card — shown only when the first-run name step was
   skipped, so most people never see it. Styled as part of the celebration, not
   as a form field. */
.nvo-reveal-namewrap { margin: 0 auto .35rem; max-width: 18rem; }
.nvo-name-input {
  width: 100%; text-align: center;
  font-family: var(--nv-font-display, inherit);
  font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em;
  color: #e2e8f0; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: .45rem .75rem; min-height: 44px; outline: none;
}
.nvo-name-input::placeholder { color: rgba(226,232,240,.38); font-weight: 700; }
.nvo-name-input:focus { border-color: rgba(103,232,249,.65); background: rgba(255,255,255,.07); }

/* ── vibe picker (Onboarding._viewTone) ────────────────────────────────────
 * Five rows, not a grid: each one carries a title AND a one-line description,
 * and on a phone a 2-column grid would squeeze both to unreadable. One tap
 * picks and goes — there is no confirm step between the kid and the result. */
.nvo-tones { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.25rem; }
.nvo-tone {
  display: flex; align-items: center; gap: 0.85rem; width: 100%;
  min-height: 60px; padding: 0.7rem 0.9rem;
  border-radius: 1rem; cursor: pointer; text-align: left;
  color: #f8fafc;
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.025));
  border: 1px solid rgba(255,255,255,0.14);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.nvo-tone:hover, .nvo-tone:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(34,211,238,.6);
  box-shadow: 0 0 0 1px rgba(34,211,238,.35), 0 10px 28px rgba(0,0,0,.35);
}
.nvo-tone:active { transform: translateY(0) scale(.99); }
/* the tap that was taken — confirms the choice for the moment before generating */
.nvo-tone.is-picked {
  border-color: #22d3ee;
  background: linear-gradient(180deg, rgba(34,211,238,.20), rgba(167,139,250,.14));
  box-shadow: 0 0 0 2px rgba(34,211,238,.5), 0 12px 30px -12px rgba(34,211,238,.7);
}
.nvo-tone[disabled] { opacity: .45; }
.nvo-tone.is-picked[disabled] { opacity: 1; }
.nvo-tone-emoji { font-size: 1.8rem; line-height: 1; flex: none; width: 2rem; text-align: center; }
.nvo-tone-text { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.nvo-tone-title { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.nvo-tone-desc { font-size: .8rem; color: #94a3b8; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) {
  .nvo-tone, .nvo-tone:hover, .nvo-tone:active { transition: none; transform: none; }
}
