/* Screen 7: Create / Upload
   Reuses chips (.chip), buttons, reward card (.vd-reward) and sheet pieces
   from the other screens; only the Create-specific parts live here. */

/* the + in the bottom bar gets a ring while Create is open */
.tab.create.active .plus { box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px rgba(185, 139, 255, 0.6), 0 0 34px var(--glow); }

.cr-scroll {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.cr-scroll::-webkit-scrollbar { display: none; }

.cr-header {
  position: sticky; top: 0;
  z-index: 3;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--status-h) + 10px);
  padding-bottom: 12px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(5, 4, 7, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.cr-heading { display: flex; flex-direction: column; gap: 3px; }

.cr-content {
  display: flex; flex-direction: column; gap: 22px;
  padding-top: 4px;
  padding-bottom: 130px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.cr-section { display: flex; flex-direction: column; gap: 10px; }
.cr-label {
  margin: 0;
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-light);
}
.cr-label em { font-style: normal; font-weight: 700; letter-spacing: 0.04em; text-transform: none; color: var(--muted); font-size: 11px; }
.cr-card { padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }

/* ---------- Media ---------- */
.cr-media { display: block; }
.cr-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 34px 20px 24px;
  border-radius: 26px;
  border: 1.5px dashed rgba(185, 139, 255, 0.45);
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(157, 92, 255, 0.2), transparent 70%),
    var(--surface);
  text-align: center;
}
.cr-drop-icon {
  width: 64px; height: 64px; border-radius: 22px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-light);
  box-shadow: 0 0 26px rgba(157, 92, 255, 0.35);
  margin-bottom: 8px;
}
.cr-drop-icon svg { width: 30px; height: 30px; }
.cr-drop-title { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.cr-drop-text { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.cr-drop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.cr-drop-actions .btn { white-space: nowrap; padding: 0 12px; }

.cr-preview {
  position: relative;
  width: 100%; max-width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  overflow: hidden;
  background: #0d0a14;
  border: 1px solid rgba(185, 139, 255, 0.45);
  box-shadow: 0 0 30px rgba(157, 92, 255, 0.2);
  animation: iv-in 0.35s ease;
}
.cr-preview video, .cr-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-preview::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent 25%, transparent 70%, rgba(0,0,0,0.6));
  pointer-events: none;
}
.cr-preview-tag, .cr-preview-dur, .cr-preview-actions { position: absolute; z-index: 1; }
.cr-preview-tag {
  top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(157, 92, 255, 0.6);
  border: 1px solid rgba(210, 182, 255, 0.6);
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.cr-preview-tag svg { width: 13px; height: 13px; }
.cr-preview-dur {
  top: 14px; right: 14px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.cr-preview-actions { left: 14px; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.cr-preview-actions button {
  flex: 1;
  min-height: 42px; border-radius: 14px;
  background: rgba(8, 6, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 800;
}

/* ---------- Venue ---------- */
.cr-search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  min-height: 48px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cr-search:focus-within { border-color: var(--accent); box-shadow: 0 0 14px rgba(157, 92, 255, 0.25); }
.cr-search svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.cr-search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--fg); font: inherit; font-size: 15px;
}
.cr-search input::placeholder { color: var(--muted); }
.cr-venues { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.cr-venues-head { margin: 0; padding: 10px 14px 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.cr-venue-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left; }
.cr-venue-row + .cr-venue-row { border-top: 1px solid var(--line); }
.cr-venue-row:hover { background: rgba(157, 92, 255, 0.07); }
.cr-venue-row .legend-dot { flex: none; }
.cr-venue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-venue-text b { font-size: 15px; font-weight: 800; }
.cr-venue-text span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cr-venue-dist { font-size: 12px; font-weight: 800; color: var(--accent-light); white-space: nowrap; }

.cr-venue-picked {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(130deg, rgba(157, 92, 255, 0.18), var(--surface) 60%);
  border: 1px solid rgba(185, 139, 255, 0.45);
  animation: iv-in 0.3s ease;
}
.cr-check {
  flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 0 14px var(--glow);
}
.cr-check svg { width: 17px; height: 17px; }
.cr-venue-picked-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-venue-picked-text b { font-size: 16px; font-weight: 800; }
.cr-venue-picked-text span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cr-venue-picked-text .cr-energy { color: var(--accent-light); font-weight: 700; }
.cr-text-btn { font-size: 13px; font-weight: 800; color: var(--accent-light); }

/* ---------- Caption ---------- */
.cr-caption {
  position: relative;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cr-caption:focus-within { border-color: var(--accent); box-shadow: 0 0 14px rgba(157, 92, 255, 0.25); }
.cr-caption textarea {
  display: block; width: 100%;
  padding: 14px 14px 26px;
  background: none; border: 0; outline: none; resize: none;
  color: var(--fg); font: inherit; font-size: 15px; line-height: 1.45;
}
.cr-caption textarea::placeholder { color: var(--muted); }
#cr-count { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Vibe ---------- */
.chip.cr-vibe { font-size: 14px; }
.chip.cr-vibe.on::before { display: none; }

/* ---------- Rating ---------- */
.cr-rate-row { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 8px; }
.cr-rate-label { font-size: 14px; font-weight: 700; color: #d9d5e3; }
.cr-stars { display: flex; gap: 0; }
.cr-stars button { position: relative; width: 36px; height: 40px; display: grid; place-items: center; color: #352e4a; transition: color 0.15s, transform 0.15s; }
.cr-stars button svg { width: 22px; height: 22px; }
.cr-stars button.on { color: var(--accent-light); filter: drop-shadow(0 0 6px var(--glow)); }
.cr-stars button:active { transform: scale(0.88); }
.cr-rate-val { font-size: 12px; font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Visibility ---------- */
.cr-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.cr-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; border-radius: 12px;
  font-size: 13px; font-weight: 800; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.cr-seg button svg { width: 16px; height: 16px; }
.cr-seg button.on { background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 0 0 1px rgba(185, 139, 255, 0.45); }

/* ---------- Reward preview ---------- */
.cr-reward { border-color: rgba(185, 139, 255, 0.28); }
.cr-reward .vd-reward-icon { background: var(--accent-soft); color: var(--accent-light); }
.cr-reward .vd-label { color: var(--accent-light); }
.cr-reward-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Post bar ---------- */
.cr-post {
  position: absolute; left: 0; right: 0;
  bottom: var(--nav-h);
  z-index: 4;
  padding-top: 8px; padding-bottom: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(8, 6, 12, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.cr-post-btn { min-height: 50px; border-radius: 16px; transition: opacity 0.2s, box-shadow 0.2s, filter 0.2s; }
.cr-post:not(.ready) .cr-post-btn { opacity: 0.45; box-shadow: none; filter: saturate(0.6); }
.cr-post-hint { margin: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.cr-post.ready .cr-post-hint { color: var(--accent-light); }

/* ---------- Upload + posted sheets ---------- */
.cr-upload { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 10px; }
.cr-upload-title { margin: 0 0 8px; font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.cr-progress { height: 8px; border-radius: 4px; background: #241f33; overflow: hidden; }
.cr-progress i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #d2b6ff); box-shadow: 0 0 14px var(--glow); transition: width 0.12s linear; }
.cr-upload-pct { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.cr-posted-venue, .cr-posted-credits { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.cr-posted-venue svg, .cr-posted-credits svg { width: 16px; height: 16px; color: var(--accent-light); }
.cr-posted-credits { font-size: 13px; color: var(--accent-light); }

/* links to Rewards */
.cr-reward > div { flex: 1; min-width: 0; }
.cr-reward-link { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; }
.cr-reward-link svg { width: 14px; height: 14px; }
button.cr-posted-credits { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid rgba(185, 139, 255, 0.4); }
.tab.create.active .plus svg { color: #fff; filter: none; }   /* keep the + white on the purple button while Create is open */
