/* =========================================================
   Learning Rewired Lab — The Lab · Builder Profile surface
   File: /the-lab/app/assets/css/builder-profile.css

   Split view: identity editor (left) + live Builder Card (right).
   Loads on top of the shared shell frame (the-lab.css).
   ========================================================= */

.bp-wrap {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  min-height: calc(100vh - var(--lab-top-h, 64px));
}

/* ---------------- EDITOR (left) ---------------- */
.bp-editor { background: #fff; border-right: 1px solid #e1e9e9; overflow-y: auto; }
.bp-editor-inner { padding: 32px 40px 52px; max-width: 520px; }

.bp-status { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.bp-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; display: block; }
.bp-status.is-live .bp-status-dot { background: #14b8a6; }
.bp-status-tx { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #0f766e; }

.bp-h1 { font-weight: 900; font-size: 26px; letter-spacing: -.03em; color: #07111f; margin: 0 0 4px; }
.bp-lead { font-size: 13.5px; color: #5a6b7e; margin: 0 0 26px; line-height: 1.5; }

.bp-field { margin-bottom: 18px; }
.bp-label { display: flex; align-items: baseline; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: 6px; }
.bp-label em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; color: #b0bcc9; }

.bp-in, .bp-ta, .bp-sel {
  width: 100%; font-family: inherit; font-size: 14px; color: #0f172a;
  padding: 11px 13px; border: 1px solid #d8e0ea; border-radius: 11px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.bp-ta { line-height: 1.5; resize: vertical; min-height: 92px; }
.bp-sel { cursor: pointer; }
.bp-in:focus, .bp-ta:focus, .bp-sel:focus { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,.14); }
.bp-in::placeholder, .bp-ta::placeholder { color: #9aa6b6; }

.bp-grid-2 { display: grid; gap: 14px; margin-bottom: 18px; }
.bp-grid-name { grid-template-columns: 1fr 160px; }
.bp-grid-loc { grid-template-columns: 1fr 200px; }

.bp-handle-wrap { display: flex; align-items: center; border: 1px solid #d8e0ea; border-radius: 11px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.bp-handle-wrap:focus-within { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,.14); }
.bp-handle-wrap span { padding: 11px 4px 11px 12px; color: #94a3b8; font-size: 14px; font-weight: 600; }
.bp-handle-wrap input { flex: 1; min-width: 0; border: none; font-family: inherit; font-size: 14px; padding: 11px 12px 11px 0; background: transparent; outline: none; color: #0f172a; }

/* avatar */
.bp-avatar-block { margin-bottom: 26px; }
.bp-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.bp-avatar-current { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; background: #0b2a2a; border: 3px solid #0f766e; box-shadow: 0 6px 16px rgba(15,118,110,.28); display: block; }
.bp-avatar-current img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-upload { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: #0f766e; background: #fff; border: 1px solid rgba(20,184,166,.4); border-radius: 10px; padding: 9px 13px; cursor: pointer; transition: background .15s; }
.bp-upload:hover { background: rgba(20,184,166,.07); }
.bp-upload input { display: none; }
.bp-remove { margin-left: 8px; font-family: inherit; font-weight: 700; font-size: 13px; color: #64748b; background: transparent; border: none; cursor: pointer; text-decoration: underline; }
.bp-remove[hidden] { display: none; }
.bp-avatar-hint { font-size: 11.5px; color: #94a3b8; margin-top: 7px; }
.bp-avatar-grid { display: flex; gap: 9px; flex-wrap: wrap; }
.bp-avatar-btn { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; padding: 0; cursor: pointer; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(15,23,42,.14); transition: transform .14s ease, border-color .14s, box-shadow .14s; background: #0b2a2a; }
.bp-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-avatar-btn:hover { transform: translateY(-2px) scale(1.07); }
.bp-avatar-btn.is-active { border-color: #0f766e; box-shadow: 0 6px 18px rgba(15,118,110,.45); }

/* save bar */
.bp-savebar { display: flex; align-items: center; gap: 14px; }
.bp-save { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 800; font-size: 14.5px; color: #fff; background: #14b8a6; border: none; border-radius: 12px; padding: 13px 24px; cursor: pointer; box-shadow: 0 10px 24px rgba(20,184,166,.26); transition: background .15s, opacity .15s; }
.bp-save:hover { background: #0f9e8e; }
.bp-save:disabled { background: #9fd6cd; opacity: .7; cursor: default; box-shadow: none; }
.bp-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #0f766e; }
.bp-saved.is-err { color: #b4530a; }
.bp-saved[hidden] { display: none; }

/* ---------------- CARD STAGE (right) ---------------- */
.bp-stage {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px;
  background: radial-gradient(70% 60% at 50% 8%, #f4fbfa 0%, #e7f1f0 58%, #dfeceb 100%);
}
.bp-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 40% at 82% 16%, rgba(20,184,166,.12), transparent 60%),
              radial-gradient(42% 42% at 12% 88%, rgba(37,99,235,.07), transparent 60%);
}
.bp-stage-head { position: relative; text-align: center; margin-bottom: 22px; }
.bp-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(20,184,166,.3); background: rgba(255,255,255,.7); border-radius: 999px; padding: 6px 13px; backdrop-filter: blur(6px); }
.bp-badge span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #14b8a6; display: block; }
.bp-badge-tx { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #0f766e; }
.bp-stage-hint { font-size: 12.5px; color: #5a6b7e; margin: 11px 0 0; }

.bp-perspective { position: relative; perspective: 1100px; }
.bp-card-tilt { position: relative; width: 352px; height: 504px; transform-style: preserve-3d; transition: transform .12s ease-out; will-change: transform; animation: bp-float 6s ease-in-out infinite; }
.bp-card-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.bp-card-flip.is-flipped { transform: rotateY(180deg); }

@keyframes bp-foil { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes bp-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.bp-face { position: absolute; inset: 0; border-radius: 26px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 30px 70px rgba(11,42,42,.34); }
.bp-face--front { z-index: 2; background: linear-gradient(125deg,#06201f 0%,#0f766e 48%,#14b8a6 100%); }
.bp-face--back { z-index: 1; transform: rotateY(180deg); background: linear-gradient(160deg,#fff 0%,#f3faf9 100%); border: 1px solid rgba(20,184,166,.18); }

.bp-foil { position: absolute; inset: 0; opacity: .5; mix-blend-mode: color-dodge; pointer-events: none; background: linear-gradient(115deg,transparent 20%,rgba(94,234,212,.5) 38%,rgba(125,211,252,.45) 48%,rgba(167,139,250,.4) 58%,transparent 76%); background-size: 300% 100%; animation: bp-foil 7s linear infinite; }
.bp-hatch { position: absolute; inset: 0; opacity: .16; pointer-events: none; background-image: repeating-linear-gradient(135deg, #fff 0 2px, transparent 2px 7px); }
.bp-hatch--ink { opacity: .06; background-image: repeating-linear-gradient(135deg,#0f766e 0 2px,transparent 2px 8px); }

.bp-front-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 0; }
.bp-lvl { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; color: #4a3200; background: linear-gradient(180deg,#fff,#fceec2); border-radius: 9px; padding: 5px 11px; box-shadow: 0 4px 10px rgba(212,160,23,.35); letter-spacing: -.02em; width: max-content; }
.bp-rarity { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #06201f; background: linear-gradient(100deg,#f4c95d,#fde9b0); border-radius: 7px; padding: 4px 9px; width: max-content; margin-top: 7px; }
.bp-moves { font-weight: 900; font-size: 38px; line-height: .8; color: rgba(255,255,255,.94); letter-spacing: -.04em; text-align: right; }
.bp-moves-lab { font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #bff3e9; margin-top: 5px; text-align: right; }

.bp-avatar-ring-wrap { position: relative; display: flex; justify-content: center; margin-top: 6px; }
.bp-avatar-ring { position: relative; width: 142px; height: 142px; }
.bp-avatar-ring::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg,#5eead4,#7dd3fc,#a78bfa,#f4c95d,#5eead4); filter: blur(2px); opacity: .85; }
.bp-avatar-ring-img { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 3px solid rgba(255,255,255,.6); background: #0b2a2a; }
.bp-avatar-ring-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bp-nameplate { position: relative; text-align: center; margin-top: 13px; padding: 0 20px; }
.bp-card-name { font-weight: 900; font-size: 24px; letter-spacing: -.03em; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.bp-card-role { font-size: 11.5px; font-weight: 700; color: #bff3e9; margin-top: 3px; letter-spacing: .01em; }

.bp-statpanel { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg,rgba(255,255,255,.97),#fff); border-top: 1px solid rgba(20,184,166,.2); padding: 15px 18px 17px; border-radius: 22px 22px 26px 26px; }
.bp-statpanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bp-statpanel-meta { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; }
.bp-sig { font-family: Caveat, cursive; font-size: 23px; color: #0f766e; transform: rotate(-4deg); line-height: 1; }
.bp-statgrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.bp-stat { text-align: center; border: 1px solid #e6eef0; border-radius: 11px; padding: 9px 4px; background: #fafdfc; }
.bp-stat-v { font-weight: 900; font-size: 19px; color: #0f766e; letter-spacing: -.02em; }
.bp-stat-k { font-size: 8.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #94a3b8; margin-top: 3px; }

/* back face */
.bp-back-inner { position: relative; padding: 20px 22px 18px; height: 100%; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none; }
.bp-back-inner::-webkit-scrollbar { display: none; }
.bp-back-head { display: flex; align-items: center; gap: 11px; }
.bp-back-av { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; background: #0b2a2a; display: block; }
.bp-back-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-back-name { font-weight: 900; font-size: 16px; color: #07111f; letter-spacing: -.02em; }
.bp-back-sub { font-size: 11px; color: #64748b; }
.bp-back-lvl { margin-left: auto; font-size: 10px; font-weight: 800; color: #8a5a00; background: rgba(244,201,93,.18); border: 1px solid rgba(212,160,23,.35); border-radius: 999px; padding: 4px 9px; flex: none; }
.bp-bio { font-size: 12.5px; line-height: 1.5; color: #475569; margin: 14px 0 0; }
.bp-section-lab { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; margin: 16px 0 9px; }
.bp-statgrid--sm .bp-stat-v { font-size: 17px; }
.bp-statgrid--sm .bp-stat-k { font-size: 8px; margin-top: 2px; }
.bp-timeline { display: flex; flex-direction: column; gap: 9px; }
.bp-badgerow { display: flex; flex-wrap: wrap; gap: 7px; }
.bp-badgechip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; flex: none; background: radial-gradient(120% 120% at 30% 20%,#0f766e,#0b5c55); color: #eafffb; box-shadow: 0 2px 8px rgba(15,118,110,.28); }
.bp-badgechip.is-locked { background: #eef2f6; color: #cbd5e1; box-shadow: none; }
.bp-badgerow-empty { font-size: 11px; font-weight: 600; color: #94a3b8; }
.bp-tl { display: flex; gap: 10px; align-items: flex-start; }
.bp-tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex: none; box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
.bp-tl-title { font-size: 12px; font-weight: 700; color: #1e293b; line-height: 1.3; }
.bp-tl-meta { font-size: 10.5px; color: #94a3b8; }
.bp-back-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #eef2f6; }
.bp-back-foot-brand { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; }

.bp-glare { position: absolute; inset: 0; border-radius: 26px; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .2s ease; mix-blend-mode: soft-light; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.7), transparent 45%); }
.bp-burst { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: visible; }

.bp-flip { position: relative; margin-top: 26px; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 800; font-size: 14px; color: #0f766e; background: #fff; border: 1px solid rgba(20,184,166,.4); border-radius: 12px; padding: 11px 20px; cursor: pointer; box-shadow: 0 6px 16px rgba(15,23,42,.06); transition: background .15s; }
.bp-flip:hover { background: rgba(20,184,166,.07); }

/* ---------------- Country / flag — a global-platform value prop ---------------- */
.bp-countryline { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(20,184,166,.08), rgba(37,99,235,.05)); border: 1px solid rgba(20,184,166,.18); }
.bp-countryline[hidden] { display: none; }
.bp-countryline__flag { font-size: 30px; line-height: 1; flex: none; filter: drop-shadow(0 2px 4px rgba(15,23,42,.15)); }
.bp-countryline__tx { line-height: 1.3; }
.bp-countryline__tx strong { display: block; font-size: 14px; font-weight: 850; color: var(--lab-ink); letter-spacing: -.01em; }
.bp-countryline__tx span { display: block; font-size: 12px; color: var(--lab-slate); font-weight: 600; }
.bp-card-flag { font-size: 20px; line-height: 1; margin-left: 8px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.25)); }
.bp-card-flag[hidden] { display: none; }
.bp-back-flag { font-size: 20px; line-height: 1; flex: none; }
.bp-back-flag[hidden] { display: none; }

/* ---------------- Badge strip (compact, above the fold) ---------------- */
.bp-badgestrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 6px; }
.bp-badgepill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750;
  padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid rgba(224,169,63,.35);
  background: linear-gradient(160deg, #fffdf6, #fff); color: var(--lab-ink);
}
.bp-badgepill-ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(140deg,#e0a93f,#f4c95d); color: #fff; font-size: 11px; flex: none; }
.bp-badgestrip-empty { font-size: 12.5px; color: var(--lab-slate); font-weight: 600; }
.bp-badgestrip-more { font-size: 12px; font-weight: 800; color: var(--lab-teal-d); text-decoration: none; padding: 6px 4px; }
.bp-badgestrip-more:hover { text-decoration: underline; }

/* ---------------- Badge showcase (trophy case) ---------------- */
.bp-badgeshelf { padding: 40px 44px 60px; background: #fff; border-top: 1px solid #e1e9e9; }
.bp-badgeshelf-head { margin-bottom: 20px; max-width: 640px; }
.bp-badgeshelf-head h2 { margin: 0; font-weight: 900; font-size: 20px; letter-spacing: -.02em; color: var(--lab-ink); }
.bp-badgeshelf-head p { margin: 6px 0 0; font-size: 13px; color: var(--lab-slate); line-height: 1.55; }
#bp-badge-grid.pf-badges { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-width: 920px; }
.pf-badge.just-earned { animation: pf-badge-pop .8s cubic-bezier(.2,.9,.3,1); }

/* responsive: stack on narrow */
@media (max-width: 900px) {
  .bp-wrap { grid-template-columns: 1fr; }
  .bp-editor { border-right: none; border-bottom: 1px solid #e1e9e9; }
  .bp-stage { padding: 40px 24px 56px; }
  .bp-badgeshelf { padding: 28px 20px 44px; }
}
