/* ============================================================
   GENIOS CREATIVOS · Mi Estudio (mi-personaje.html)
   Tema claro "sala de trofeos". Re-estiliza las MISMAS clases
   que genera el JS de Supabase, para que sea drop-in.
   Carga DESPUÉS de css/genios.css.
   ============================================================ */

body.page-personaje { background: var(--paper); }

/* ── HERO de estudio ── */
.studio-hero { position: relative; text-align: center; padding: 40px 22px 26px; overflow: hidden; }
.studio-mascot { width: 140px; height: 140px; margin: 0 auto 14px; position: relative; }
.studio-mascot img {
  width: 100%; height: 100%; object-fit: contain; cursor: pointer;
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.2)); animation: float 4s ease-in-out infinite;
}
.studio-hero h1 { font-size: clamp(36px,6vw,60px); font-weight: 700; color: var(--ink); }
.studio-hero h1 span { color: var(--blue); }
.studio-hero .sub { font-size: 18px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }

.container { max-width: 980px; margin: 0 auto; padding: 0 22px 80px; }

/* ── Encabezado de sección (icono + título) ── */
.page-personaje .section-head {
  display: flex; align-items: center; gap: 14px; max-width: none;
  margin: 50px 0 22px;
}
.page-personaje .section-head .icon {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 24px; color: #fff;
  box-shadow: 0 5px 0 rgba(0,0,0,.12);
}
.icon-blue   { background: var(--blue);   box-shadow: 0 5px 0 var(--blue-d) !important; }
.icon-purple { background: var(--purple); box-shadow: 0 5px 0 #6E40D6 !important; }
.icon-gold   { background: var(--gold);   box-shadow: 0 5px 0 #D98C00 !important; }
.icon-green  { background: var(--green);  box-shadow: 0 5px 0 #169A50 !important; }
.page-personaje .section-head h2 { font-size: clamp(22px,3.2vw,30px); font-weight: 700; color: var(--ink); margin: 0; }
.page-personaje .section-head h2 span { color: var(--blue); }

/* ── Card base ── */
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }

/* ── PROTAGONISTA ── */
.protagonist-card {
  display: flex; gap: 26px; align-items: flex-start;
  background: linear-gradient(135deg, color-mix(in srgb,var(--blue) 10%,#fff), color-mix(in srgb,var(--purple) 8%,#fff));
  border: 2px solid color-mix(in srgb,var(--blue) 26%,#fff);
  border-radius: var(--r-lg); padding: 30px; box-shadow: var(--shadow);
}
.avatar-circle {
  width: 130px; height: 130px; border-radius: 28px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: grid; place-items: center; font-family: var(--font-display);
  font-size: 52px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 0 var(--blue-d), var(--shadow);
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.protagonist-info { flex: 1; min-width: 0; }
.protagonist-name {
  font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--ink);
  line-height: 1.05; margin-bottom: 8px;
}
.arquetipo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: #fff; padding: 6px 16px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; margin-bottom: 14px;
  box-shadow: 0 4px 0 #D98C00;
}
.protagonist-desc { font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.7; }
.expand-btn {
  background: #fff; border: 2px solid var(--line); color: var(--blue);
  padding: 9px 18px; border-radius: 999px; font-family: var(--font-display);
  font-weight: 600; font-size: 14px; cursor: pointer; margin-top: 14px; transition: .18s;
}
.expand-btn:hover { border-color: var(--blue); transform: translateY(-2px); }

/* Galería de retratos */
.retratos-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 14px; margin-top: 20px; }
.retrato-card {
  border-radius: 18px; overflow: hidden; border: 2px solid var(--line); background: #fff;
  aspect-ratio: 3/4; position: relative; box-shadow: var(--shadow-sm); transition: transform .18s;
}
.retrato-card:hover { transform: translateY(-5px) rotate(-1deg); }
.retrato-card img { width: 100%; height: 100%; object-fit: cover; }
.retrato-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(15,22,48,.82));
  padding: 18px 12px 10px; font-family: var(--font-display); font-weight: 600;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #fff;
}

/* ── SECUNDARIOS ── */
.secundarios-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 16px; }
.secundario-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow-sm); transition: transform .18s, border-color .18s;
}
.secundario-card:hover { transform: translateY(-5px); border-color: var(--blue); }
.sec-avatar {
  width: 82px; height: 82px; border-radius: 22px; margin: 0 auto 12px; overflow: hidden;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 32px; font-weight: 700; color: #fff;
}
.sec-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sec-avatar.aliado  { background: var(--green);  box-shadow: 0 5px 0 #169A50; }
.sec-avatar.villano { background: var(--red);    box-shadow: 0 5px 0 #D43344; }
.sec-avatar.neutro  { background: var(--blue);   box-shadow: 0 5px 0 var(--blue-d); }
.sec-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.sec-tipo { font-weight: 900; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sec-tipo.aliado  { color: var(--green); }
.sec-tipo.villano { color: var(--red); }
.sec-tipo.neutro  { color: var(--blue); }
.sec-arquetipo { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }

/* ── PORTAFOLIO POR MÓDULO ── */
.modulos-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 16px; }
.modulo-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-sm); transition: border-color .18s, transform .18s;
}
.modulo-card:hover { transform: translateY(-4px); }
.modulo-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modulo-num {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 700; font-size: 17px; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.14);
}
.m1 .modulo-num { background: var(--m1); } .m2 .modulo-num { background: var(--m2); }
.m3 .modulo-num { background: var(--m3); } .m4 .modulo-num { background: var(--m4); }
.m5 .modulo-num { background: var(--m5); } .m6 .modulo-num { background: var(--m6); }
.modulo-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); }
.modulo-sub { font-size: 13px; font-weight: 700; color: var(--ink-3); }

.entrega-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 2px solid var(--line); }
.entrega-item:first-child { border-top: none; padding-top: 0; }
.entrega-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.dot-done { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb,var(--green) 22%,transparent); }
.dot-pending { background: #D2D7EA; }
.entrega-label { font-size: 14px; font-weight: 600; color: var(--ink-3); flex: 1; line-height: 1.4; }
.entrega-label.done { color: var(--ink); }
.entrega-texto-preview {
  background: #F7F9FF; border: 2px solid var(--line); border-radius: 12px; padding: 12px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.6;
  max-height: 84px; overflow: hidden; position: relative; margin-top: 8px;
}
.entrega-texto-preview::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 26px; background: linear-gradient(transparent, #F7F9FF); }
.yt-embed-wrapper { margin-top: 10px; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; background: #000; border: 2px solid var(--line); }
.yt-embed-wrapper iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── PROGRESO ── */
.progress-bar-wrap { background: #EAEDFA; border-radius: 999px; height: 16px; overflow: hidden; margin-bottom: 10px; box-shadow: inset 0 2px 4px rgba(30,37,71,.12); }
.progress-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #38E08A); transition: width .9s cubic-bezier(.34,1.4,.5,1); }
.progress-label { font-size: 15px; font-weight: 700; color: var(--ink-2); margin-bottom: 22px; }
.progress-label strong { color: var(--ink); }
.clases-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(54px,1fr)); gap: 10px; }
.clase-circle {
  aspect-ratio: 1/1; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; position: relative; transition: transform .15s;
}
.clase-circle:hover { transform: scale(1.1) rotate(-3deg); }
.clase-circle.completada { background: var(--green); color: #fff; box-shadow: 0 4px 0 #169A50; }
.clase-circle.disponible { background: #fff; color: var(--blue); border: 3px solid var(--blue); }
.clase-circle.bloqueada { background: #EEF0F8; color: var(--ink-3); border: 2px dashed #C9CEE4; }
.clase-num-label { font-size: 9px; opacity: .7; margin-top: 1px; }

/* ── EMPTY STATE ── */
.empty-state { background: #F7F9FF; border: 2px dashed #C9CEE4; border-radius: var(--r); padding: 34px 24px; text-align: center; }
.empty-state .ico { font-size: 40px; margin-bottom: 10px; }
.empty-state p { color: var(--ink-2); font-weight: 600; font-size: 15px; line-height: 1.6; }
.empty-state a { color: var(--blue); font-weight: 800; }
.empty-state a:hover { text-decoration: underline; }

/* ── LOADING ── */
.loading-spinner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 70px 0; color: var(--ink-3); font-weight: 700; font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 4px solid #DCE2F5; border-top-color: var(--blue); animation: spin .7s linear infinite; }

/* ── FOOTER ── */
.page-personaje footer { text-align: center; padding: 44px 22px 60px; color: var(--ink-3); font-weight: 700; font-size: 13px; border-top: 2px solid var(--line); }
.page-personaje footer strong { color: var(--ink-2); }

@media (max-width: 700px) {
  .protagonist-card { flex-direction: column; align-items: center; text-align: center; }
  .modulos-grid { grid-template-columns: 1fr; }
  .clases-grid { grid-template-columns: repeat(auto-fill,minmax(46px,1fr)); gap: 8px; }
}
