/* create.css — the guided creation ritual, genesis moment, and modal. */

#screen-create { padding: max(.8rem, env(safe-area-inset-top)) 1.1rem 1rem; }

.create-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.btn-cancel { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 1rem; }
.btn-cancel:active { background: var(--surface-2); }

/* Clickable step flow */
.stepper { flex: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: .2rem; }
.stp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; position: relative; color: var(--faint); }
.stp::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--surface-2); z-index: 0; }
.stp:first-child::before { display: none; }
.stp i { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: .82rem; background: var(--surface-2); color: var(--faint); border: 1.5px solid transparent; position: relative; z-index: 1; transition: all .2s var(--ease); }
.stp small { font-size: .64rem; letter-spacing: .02em; }
.stp.done i, .stp.reach i { background: rgba(251,191,36,.16); color: var(--gold); }
.stp.done::before, .stp.cur::before { background: var(--gold-2); }
.stp.cur i { background: var(--bubble-you); color: var(--accent-ink); box-shadow: var(--glow); }
.stp.cur small { color: var(--gold); }
.stp[disabled] { cursor: default; }
.stp:not([disabled]):active i { transform: scale(.92); }

/* Maestro guide — a little taller, Maestro "speaks" the line (typed + looping) */
.guide { display: flex; align-items: center; gap: .9rem; min-height: 84px; background: linear-gradient(135deg, rgba(251,191,36,.07), rgba(245,158,11,.04)); border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; margin-bottom: .9rem; }
.guide-fig { width: 60px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; }
.guide-fig .maestro { --mw: 60px; }
.guide-line { flex: 1; font-family: var(--font-ui); font-style: normal; color: var(--text); font-size: 1.04rem; line-height: 1.4; min-height: 2.8em; }
.guide-line.typing::after { content: "▍"; color: var(--gold); margin-left: 2px; animation: caret 1s steps(1) infinite; }

/* Persistent selected-avatar preview */
.preview { display: flex; align-items: stretch; gap: 1rem; height: 98px; background: linear-gradient(135deg, rgba(251,191,36,.12), rgba(245,158,11,.10)); border: 2px solid var(--gold); border-radius: 16px; padding: 0; overflow: hidden; margin-bottom: .9rem; animation: rise .3s var(--ease); box-shadow: var(--glow); }
.preview-ava { align-self: stretch; height: 100%; aspect-ratio: 1 / 1; flex: none; overflow: hidden; }
.preview-ava .ava-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-meta { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding-right: 1rem; }
.preview-meta b { font-size: 1.12rem; text-transform: uppercase; color: var(--gold); font-weight: 800; letter-spacing: .03em; }
.preview-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.preview-chips span { font-size: .72rem; color: var(--muted); background: var(--surface-2); padding: .15rem .5rem; border-radius: 999px; }

.create-body { flex: 1; min-height: 0; overflow-y: auto; padding: .2rem .1rem 1rem; }

/* Desktop: hide the creation scrollbar (still scrolls via wheel/touch) */
@media (min-width: 820px) {
  #create-body { scrollbar-width: none; }
  #create-body::-webkit-scrollbar { display: none; }
}
.create-body h2 { font-size: clamp(1.45rem, 5.5vw, 2rem); margin-bottom: .3rem; text-align: center; }
.create-body .step-sub { color: var(--muted); margin-bottom: 1.2rem; text-align: center; }

/* Men / Women tabs */
.tabs { display: flex; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem; margin-bottom: 1.2rem; }
.tab { flex: 1; padding: .8rem; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .05em; transition: all .2s var(--ease); }
.tab.on { background: var(--bubble-you); color: var(--accent-ink); }

/* Face-set sub-tabs (paginate 32 faces → 2 sets of 16) */
.set-tabs { display: flex; gap: .4rem; justify-content: center; margin-bottom: 1rem; }
.set-tab { padding: .45rem 1.1rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); font-weight: 700; font-size: .85rem; transition: all .15s var(--ease); }
.set-tab.on { border-color: var(--gold); color: var(--gold); background: var(--surface-2); }

/* Grids */
.grid { display: grid; gap: .7rem; }
.grid.faces { grid-template-columns: repeat(3, 1fr); }
.grid.chips { grid-template-columns: repeat(2, 1fr); }
.grid.chips.icons { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .grid.faces { grid-template-columns: repeat(4, 1fr); } .grid.chips { grid-template-columns: repeat(3, 1fr); } }

.face-card { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 2.5px solid transparent; background: var(--surface-2); transition: border-color .15s var(--ease), transform .15s var(--ease); }
.face-card .ava-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-card.sel { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--glow); }

.chip { padding: .9rem 1rem; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font-weight: 600; font-size: 1rem; text-align: center; transition: all .15s var(--ease); }
.chip.sel { border-color: var(--accent); background: var(--surface-2); color: var(--accent); }
.chip.ico { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1rem .6rem; font-size: .92rem; }
.chip.ico .ic { font-size: 1.7rem; line-height: 1; }

.field-label { font-size: .85rem; color: var(--muted); margin: .4rem 0 .3rem; }
.name-input { width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; font-size: 1.3rem; text-align: center; }
.name-input:focus { outline: none; border-color: var(--accent); }
.suggest-label { font-size: .85rem; color: var(--muted); text-align: center; margin: 1.3rem 0 .6rem; }
.name-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.name-chip { padding: .55rem 1rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font-weight: 600; transition: all .15s var(--ease); }
.name-chip.sel { border-color: var(--accent); background: var(--surface-2); color: var(--gold); }
.name-chip:active { transform: scale(.95); }

/* Footer nav — both buttons clearly visible */
.create-foot { display: flex; gap: .7rem; align-items: center; padding-top: .8rem; }
.create-foot .btn { flex: 1; }
.btn-back { flex: none; height: 56px; padding: 0 1.2rem; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font-size: .98rem; font-weight: 700; white-space: nowrap; }
.btn-back:active { background: var(--surface-2); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(0,0,0,.6); }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; max-width: 360px; text-align: center; animation: rise .25s var(--ease); }
.modal-box h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.modal-box p { color: var(--muted); margin-bottom: 1.2rem; line-height: 1.5; }
.modal-actions { display: flex; gap: .6rem; }
.modal-actions .btn { flex: 1; }
.btn-soft { flex: 1; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 700; border-radius: 999px; padding: 1rem 1.2rem; }
.btn-soft:active { transform: scale(.97); }

/* ── Quick tour — cinematic poster slides (real photo collage + the "why") ──
   Palette is drawn from the slide photos: sunset coral + teal tech-glow on a
   near-black stage. Deliberately NOT the gold CTA nor a flat blue. */
.tour { position: fixed; inset: 0; z-index: 65; display: none; align-items: center; justify-content: center; padding: 0; background: rgba(4,3,8,.92); backdrop-filter: blur(8px); }
.tour.open { display: flex; animation: fade .35s var(--ease); }

.tour-card { position: relative; width: min(940px, 100vw); height: min(660px, 100vh);
  overflow: hidden; background: #0b0910; box-shadow: var(--shadow); animation: rise .4s var(--ease); }

/* The photo collage fills the whole card; text floats over a bottom scrim. */
.tour-collage { position: absolute; inset: 0; display: grid; gap: 3px; background: #07060c; transform-origin: 60% 40%; }
.tour-cimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-collage.solo { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.tour-collage.mosaic { grid-template-columns: 1.65fr 1fr; grid-template-rows: 1fr 1fr; }
.tour-collage.mosaic .tour-cimg:nth-child(1) { grid-row: 1 / 3; }
/* slow ambient push-in so the stills feel alive on each slide */
.tour-card.in .tour-collage { animation: t-zoom 9s var(--ease) both; }
@keyframes t-zoom { from { transform: scale(1.07); } to { transform: scale(1); } }

.tour-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 5rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, transparent, rgba(9,7,13,.72) 18%, rgba(9,7,13,.94) 44%, rgba(9,7,13,.99)); }
.tour-text { max-width: 660px; }
/* Title: solid bright gold + heavy shadow — must read on ANY photo behind it. */
.tour-title { font-size: clamp(1.55rem, 6vw, 2.15rem); line-height: 1.1; margin-bottom: .55rem;
  color: #ffd76a; text-shadow: 0 2px 4px rgba(0,0,0,.95), 0 4px 26px rgba(0,0,0,.75); }
.tour-body { color: #ffffff; font-weight: 700; font-size: 1.04rem; line-height: 1.56; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 2px 14px rgba(0,0,0,.6); }

/* replay slide-in motion on every change */
.tour-card.in .tour-text { animation: t-slide .55s var(--ease) both; }
@keyframes t-slide { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.tour-lang { position: absolute; top: 1rem; left: 1rem; z-index: 4; padding: .4rem .85rem; border-radius: 999px;
  background: rgba(11,9,16,.55); color: #6fe0d0; border: 1px solid rgba(111,224,208,.5); font-size: .82rem; font-weight: 700; backdrop-filter: blur(6px); }
.tour-close { position: absolute; top: 1rem; right: 1rem; z-index: 4; padding: .4rem .95rem; border-radius: 999px;
  background: rgba(11,9,16,.55); border: 1px solid rgba(255,255,255,.24); color: #fff; font-size: .82rem; font-weight: 700; backdrop-filter: blur(6px); }

.tour-dots { display: flex; gap: .5rem; margin: 1rem 0 .9rem; }
.tour-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.3); cursor: pointer; transition: all .2s var(--ease); }
.tour-dot.on { background: #6fe0d0; width: 24px; border-radius: 999px; box-shadow: 0 0 12px rgba(111,224,208,.6); }

.tour-nav { display: flex; gap: .7rem; width: 100%; max-width: 660px; }
.tour-nav .btn { flex: 1; color: #2a0f12; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(135deg, #ff9e76, #ff6f8e); box-shadow: 0 8px 26px rgba(255,111,142,.32); }
.tour-nav .btn-soft { width: 56px; flex: none; background: rgba(11,9,16,.5); border: 1px solid rgba(255,255,255,.22); color: #f4ead9; }
.tour-nav.solo .btn-soft { display: none; }   /* first slide: Next spans full width, centered */

@media (min-width: 820px) {
  .tour-card { border-radius: 24px; }
  .tour-foot { padding: 5.5rem 2.6rem 1.9rem; }
}

/* Genesis — the "birth" (forked from v1's skill-forge birth animation) */
.genesis { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 1.4rem;
  background: rgba(4,3,8,.82); backdrop-filter: blur(8px); }
.genesis.on { display: flex; animation: fade .4s var(--ease); }
.g-card { position: relative; width: min(420px, 92vw); border-radius: 28px; overflow: hidden; padding: 2.2rem 1.6rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.3rem; animation: g-rise .5s ease-out both;
  background: radial-gradient(ellipse at top, rgba(76,29,149,.45) 0%, rgba(20,15,40,.96) 55%, rgba(8,7,16,.99) 100%);
  border: 1px solid rgba(167,139,250,.32); box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 80px rgba(251,191,36,.12); }
.g-accent { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #fbbf24, #a78bfa, #fbbf24, transparent); }

.g-stage { position: relative; width: 230px; height: 230px; flex: none; }
.g-particle { position: absolute; width: 6px; height: 6px; border-radius: 50%; left: 50%; top: 50%; margin: -3px 0 0 -3px; z-index: 2; animation: g-orbit 6s linear infinite; }
.g-orb { position: absolute; inset: 0; margin: auto; width: 184px; height: 184px; border-radius: 50%; opacity: .5; filter: blur(3px); z-index: 1;
  background: radial-gradient(circle at 30% 30%, #fde68a 0%, #fbbf24 35%, #a78bfa 75%, #4c1d95 100%); animation: g-pulse 2.4s ease-in-out infinite; }
.g-ava { position: absolute; inset: 0; margin: auto; width: 172px; height: 172px; border-radius: 50%; overflow: hidden; z-index: 3;
  border: 3px solid rgba(251,191,36,.7); box-shadow: 0 0 50px rgba(251,191,36,.55), 0 0 90px rgba(167,139,250,.35); }
.g-ava .ava-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-spark { position: absolute; inset: 0; margin: auto; width: 172px; height: 172px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 4.2rem; z-index: 4;
  background: radial-gradient(circle at 30% 30%, #fde68a 0%, #fbbf24 35%, #a78bfa 75%, #4c1d95 100%); box-shadow: 0 0 60px rgba(251,191,36,.7); }
.genesis.done .g-ava { display: none; }
.genesis.done .g-spark { display: flex; animation: g-rise .4s ease-out; }

.g-panel { width: min(360px, 86vw); border-radius: 18px; padding: 1rem 1.1rem; animation: g-rise .5s ease-out both;
  background: rgba(8,7,16,.55); border: 1px solid rgba(167,139,250,.35); backdrop-filter: blur(4px); }
.g-status { font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #a78bfa; margin-bottom: .5rem; }
.genesis.done .g-status { color: #34d399; }
.g-phase { font-size: .95rem; font-weight: 500; color: var(--gold); min-height: 1.5em; margin-bottom: .7rem; }
.g-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.g-bar > i { display: block; height: 100%; width: 100%; border-radius: 999px;
  background-image: linear-gradient(90deg, rgba(251,191,36,.15), rgba(251,191,36,.85) 50%, rgba(251,191,36,.15)); background-size: 200% 100%; animation: g-shimmer 1.6s linear infinite; }
.genesis.done .g-bar > i { background: #34d399; animation: none; }

.g-title { font-size: clamp(1.5rem, 6vw, 2.2rem); animation: g-rise .5s ease-out both;
  background: linear-gradient(90deg, #fbbf24 0%, #a78bfa 50%, #fbbf24 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

@keyframes g-orbit { 0% { transform: rotate(0deg) translateX(104px) rotate(0deg); opacity: .55; } 100% { transform: rotate(360deg) translateX(104px) rotate(-360deg); opacity: .55; } }
@keyframes g-pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 50px rgba(251,191,36,.55), inset 0 0 32px rgba(167,139,250,.35); } 50% { transform: scale(1.06); box-shadow: 0 0 90px rgba(251,191,36,.85), inset 0 0 50px rgba(167,139,250,.55); } }
@keyframes g-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes g-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
