/* Mundo Primaria · Entrenadores · Compartir con la clase · v0.1.1 (16-11-2026).
 * 0.1.1 (Mikel, 16-11-2026): el botón resalta más, como el estilo «b» probado en las lecturas: fondo #e3f6fa, borde
 * #7cc9d8 e icono naranja (#f26b1d, el de los botones naranjas de la web) con trazo 2.4. El panel no cambia.
 * Botón en el título del entrenador (a la derecha en ordenador; debajo del subtítulo en el móvil) y panel que se abre
 * encima, sin mover el juego. Usa los colores de entrenador-*.css (variables --mpe-*). */

/* El título pasa a dos columnas: texto a la izquierda, el botón a la derecha */
.mpe .mpe-titular.mpe-con-compartir { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: start; }
.mpe .mpe-titular.mpe-con-compartir > .mpe-titulo,
.mpe .mpe-titular.mpe-con-compartir > .mpe-subtitulo { grid-column: 1; }
.mpe .mpe-titular.mpe-con-compartir > .mpe-compartir { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.mpe .mpe-compartir { position: relative; text-align: left; }
.mpe button.mpe-compartir-boton {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 22px;
  background: #e3f6fa; color: var(--mpe-petroleo);
  border: 2px solid #7cc9d8; border-radius: 999px;
  font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.mpe button.mpe-compartir-boton:hover,
.mpe .mpe-compartir-abierto button.mpe-compartir-boton { background: #cfeef5; border-color: var(--mpe-turquesa); }
.mpe .mpe-compartir svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mpe button.mpe-compartir-boton svg { stroke: #f26b1d; stroke-width: 2.4; }

/* Panel: flota encima del juego, no lo empuja */
.mpe .mpe-compartir-panel {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 40;
  width: 500px; max-width: calc(100vw - 48px);
  padding: 28px; background: #fff;
  border: 2px solid #9fd2dd; border-radius: 22px;
  box-shadow: 0 18px 40px rgba(11, 61, 110, .18);
  text-align: left;
}
.mpe .mpe-compartir-panel[hidden] { display: none; }
.mpe button.mpe-compartir-cerrar {
  position: absolute; top: 14px; right: 14px;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; color: var(--mpe-suave); border: 0; border-radius: 50%; cursor: pointer;
}
.mpe button.mpe-compartir-cerrar:hover { background: var(--mpe-claro); color: var(--mpe-marino); }
.mpe p.mpe-compartir-titulo { margin: 0 48px 0 0; padding: 0; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--mpe-marino); text-align: left; }
.mpe p.mpe-compartir-nivel { margin: 12px 0 0; padding: 0; font-size: 15px; line-height: 1.5; color: var(--mpe-texto); text-align: left; }
.mpe p.mpe-compartir-nivel strong { color: var(--mpe-marino); font-weight: 700; }

.mpe .mpe-compartir-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.mpe .mpe-compartir-accion {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 16px; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; white-space: nowrap;
  text-decoration: none; cursor: pointer; box-sizing: border-box;
  transition: background-color .15s, border-color .15s;
}
.mpe a.mpe-compartir-classroom,
.mpe a.mpe-compartir-classroom:visited { background: var(--mpe-petroleo); color: #fff; border: 2px solid var(--mpe-petroleo); text-decoration: none; }
.mpe a.mpe-compartir-classroom:hover,
.mpe a.mpe-compartir-classroom:focus { background: var(--mpe-marino); border-color: var(--mpe-marino); color: #fff; text-decoration: none; }
.mpe a.mpe-compartir-classroom:focus-visible { outline: 3px solid var(--mpe-marino); outline-offset: 3px; }
.mpe button.mpe-compartir-copiar { background: #fff; color: var(--mpe-petroleo); border: 2px solid #9fd2dd; }
.mpe button.mpe-compartir-copiar:hover { background: var(--mpe-claro); border-color: var(--mpe-turquesa); }

.mpe input.mpe-compartir-enlace {
  display: block; width: 100%; height: 42px; margin: 20px 0 0; padding: 0 14px;
  background: #f5fbfc; color: var(--mpe-suave);
  border: 1px solid var(--mpe-linea); border-radius: 10px; box-shadow: none;
  font-family: inherit; font-size: 13px; line-height: 40px;
}
.mpe input.mpe-compartir-enlace:focus { outline: 2px solid var(--mpe-turquesa); outline-offset: 1px; }
.mpe p.mpe-compartir-aviso { margin: 0; padding: 0; font-size: 14px; line-height: 1.4; text-align: left; }
.mpe p.mpe-compartir-aviso:empty { display: none; }
.mpe p.mpe-compartir-aviso.mpe-compartir-bien,
.mpe p.mpe-compartir-aviso.mpe-compartir-mal { margin-top: 14px; }
.mpe p.mpe-compartir-aviso.mpe-compartir-bien { color: var(--mpe-bien); font-weight: 700; }
.mpe p.mpe-compartir-aviso.mpe-compartir-mal { color: var(--mpe-mal); }

/* Móvil: el botón, centrado debajo del subtítulo; el panel, a todo el ancho del título */
@media (max-width: 640px) {
  .mpe .mpe-titular.mpe-con-compartir { display: block; position: relative; }
  .mpe .mpe-titular.mpe-con-compartir > .mpe-compartir { position: static; margin-top: 16px; text-align: center; }
  .mpe button.mpe-compartir-boton { height: 44px; padding: 0 20px; font-size: 14px; }
  .mpe .mpe-compartir-panel { left: 0; right: 0; width: auto; max-width: none; top: calc(100% + 12px); padding: 24px 20px; }
  .mpe p.mpe-compartir-titulo { font-size: 17px; margin-right: 44px; }
  .mpe .mpe-compartir-acciones { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
}
