/* =============================================================================
   Pasaporte de genio (v1.93.0) · identidad de marca del 17/11: Fredoka (títulos), Nunito (texto), Caveat (a mano)
   Maqueta aprobada por Malda: coordinacion › pasaporte/vista-previa-pasaporte-genios.html. Medidas y animaciones, de ahí.
   Todo cuelga de .pg (portal de familias y ficha) para no tocar nada de lo de siempre.
   ============================================================================= */
.pg, .pg-tarjeta, .pg-cierre, .pg-ficha {
  --pg-bg: #FBF6EE; --pg-paper: #FFFDF9; --pg-ink: #3B2418; --pg-muted: #7A6455; --pg-line: #EADFCF;
  --pg-sun: #F2B33D; --pg-sun-soft: #FCEBC4; --pg-orange: #E8892F; --pg-hueco: #C2410C;
  --pg-d: 'Fredoka', 'Nunito', system-ui, sans-serif; --pg-b: 'Nunito', system-ui, sans-serif; --pg-h: 'Caveat', cursive;
  font-family: var(--pg-b); color: var(--pg-ink);
}
:where(.pg, .pg-tarjeta, .pg-cierre, .pg-ficha) * { box-sizing: border-box; }
:where(.pg, .pg-tarjeta, .pg-cierre, .pg-ficha) button { font: inherit; color: inherit; cursor: pointer; } /* :where = sin peso, para que cada botón mande en su color */
.pg-mano { font-family: var(--pg-h); font-weight: 700; }
.pg-muted { color: var(--pg-muted); }

/* la cara redonda de cada genio */
.pg-cara { display: inline-block; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--c, #eee); border: 2.5px solid var(--c, #ccc); box-shadow: 0 0 0 2px #fff inset; }
.pg-cara img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-rayos { display: inline-block; width: 22px; height: 20px; vertical-align: middle; }

/* ---- la tarjeta del panel (rincón del niño) ---- */
.pg-tarjeta { background: var(--pg-paper); border: 2px solid var(--pg-line); border-radius: 22px; padding: 14px 16px; display: grid; gap: 10px; }
.pg-tarjeta[hidden] { display: none; }
.pg-tarjeta h3 { font: 600 1.15rem/1.15 var(--pg-d); margin: 0; display: flex; align-items: center; gap: 6px; }
.pg-tarjeta .pg-eti { font: 800 .7rem/1 var(--pg-b); letter-spacing: .12em; text-transform: uppercase; color: var(--pg-hueco); }
.pg-tarjeta .pg-nuevo { display: inline-block; background: var(--pg-hueco); color: #fff; font: 800 .68rem var(--pg-b); letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; }
.pg-minisellos { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pg-minisellos .pg-cara { width: 34px; height: 34px; }
.pg-minisellos .pg-hueco { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed #DCC9AE; background: rgba(255,255,255,.5); }
.pg-btn { border: 0; background: var(--pg-hueco); color: #fff; border-radius: 99px; padding: 12px 22px; font: 600 1rem var(--pg-d); box-shadow: 0 5px 0 #8a2e08; min-height: 44px; }
.pg-btn:disabled { background: #bba; box-shadow: none; cursor: default; }
.pg-btn.pg-sec { background: #fff; color: var(--pg-ink); border: 2px solid var(--pg-line); box-shadow: none; }
.pg-btn.pg-oscuro { background: var(--pg-ink); box-shadow: 0 6px 0 #1e110a; }

/* ---- la capa a pantalla completa ---- */
.pg { position: fixed; inset: 0; z-index: 70; background: var(--pg-bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pg[hidden] { display: none; }
.pg-col { max-width: 430px; min-height: 100%; margin: 0 auto; background: var(--pg-paper); position: relative; display: flex; flex-direction: column; }
.pg-barra { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(255,253,249,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--pg-line); }
.pg-barra.pg-clara { background: transparent; border-bottom: 0; }
.pg-cerrar { border: 2px solid var(--pg-line); background: #fff; border-radius: 99px; padding: 6px 14px; font: 700 .85rem var(--pg-b); min-height: 40px; }
.pg-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 10px 12px 18px; margin-top: auto; }
.pg-tab { border: 2px solid var(--pg-line); background: var(--pg-paper); border-radius: 99px; padding: 8px 14px; font: 700 .85rem var(--pg-b); min-height: 40px; }
.pg-tab[aria-pressed=true] { background: var(--pg-ink); border-color: var(--pg-ink); color: #fff; }
.pg-sc { padding: 6px 18px 12px; }
.pg-titulo { display: block; font: 600 1.5rem/1.15 var(--pg-d); }
.pg-sub { display: block; font-size: .88rem; color: var(--pg-muted); margin: 4px 0 14px; }
.pg-papel { background: var(--pg-paper) repeating-linear-gradient(0deg, transparent 0 27px, #F1E7D8 27px 28px); }

/* portada */
.pg-portada { flex: 1; min-height: 100vh; padding: 40px 22px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative;
  background: radial-gradient(120% 70% at 50% 0%, #FFE7A8 0%, #F6C55B 45%, #E8892F 100%); }
.pg-portada::after { content: ""; position: absolute; inset: 10px; border: 2px dashed rgba(255,255,255,.65); border-radius: 28px; pointer-events: none; }
.pg-portada .pg-sol { width: 64px; height: auto; margin-bottom: 4px; filter: drop-shadow(0 4px 6px rgba(120,60,0,.25)); }
.pg-portada .pg-mg { font: 800 .7rem/1 var(--pg-b); letter-spacing: .2em; text-transform: uppercase; color: #7a3b06; }
.pg-portada h2 { font: 700 2rem/1.1 var(--pg-d); color: #3B2418; margin: 6px 0 12px; }
.pg-portada .pg-ventana { width: 100%; border-radius: 120px 120px 22px 22px; overflow: hidden; border: 5px solid #fff; box-shadow: 0 10px 24px -12px rgba(90,40,0,.6); }
.pg-portada .pg-ventana img { width: 100%; aspect-ratio: 1 / .82; object-fit: cover; object-position: 50% 30%; display: block; }
.pg-portada .pg-nombre { font-family: var(--pg-h); font-weight: 700; font-size: 2.3rem; line-height: 1; margin: 14px 0 2px; color: #3B2418; }
.pg-portada .pg-tri { font: 800 .7rem var(--pg-b); letter-spacing: .14em; text-transform: uppercase; color: #7a3b06; }
.pg-portada .pg-abrir { margin-top: auto; padding-top: 18px; }
.pg-portada .pg-abrir .pg-btn { position: relative; z-index: 1; }

/* sellos */
.pg-sellos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; }
.pg-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; }
.pg-disco { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.pg-disco.pg-lleno { transform: rotate(var(--r, 0deg)); background: var(--cs); border: 3px dashed var(--c); box-shadow: 0 0 0 4px var(--pg-paper), 0 0 0 6px var(--c); }
.pg-disco.pg-lleno .pg-cara { width: 58px; height: 58px; border: 0; box-shadow: none; }
.pg-disco.pg-vacio { border: 2.5px dashed #DCC9AE; color: #C9B391; font: 600 1.3rem var(--pg-d); background: rgba(255,255,255,.5); }
.pg-slot .pg-lab { font-size: .74rem; line-height: 1.2; text-align: center; color: var(--pg-muted); }
.pg-slot .pg-lab b { display: block; color: var(--pg-ink); font: 600 .86rem var(--pg-d); }
.pg-slot[aria-pressed=true] .pg-disco { outline: 3px solid var(--pg-sun); outline-offset: 3px; }
.pg-frase { min-height: 3.2em; margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--pg-sun-soft); font-family: var(--pg-h); font-weight: 700; font-size: 1.3rem; line-height: 1.2; color: #6b3f1f; text-align: center; }

/* equipo */
.pg-equipo { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 2px; margin: 6px 0 14px; }
.pg-equipo .pg-m { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 .78rem var(--pg-d); opacity: .42; filter: grayscale(.7); text-align: center; }
.pg-equipo .pg-m.pg-on { opacity: 1; filter: none; }
.pg-equipo .pg-m .pg-cara { width: 44px; height: 44px; }
.pg-equipo .pg-m.pg-on .pg-cara { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.pg-gcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: var(--cs); margin-bottom: 10px; }
.pg-gcard .pg-cara { width: 62px; height: 62px; }
.pg-gcard strong { font: 600 1.15rem var(--pg-d); display: block; }
.pg-gcard span { font-size: .86rem; line-height: 1.35; display: block; }
.pg-bienvenida { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px; border: 2px dashed var(--pg-sun); border-radius: 18px; background: #FFF8E6; }
.pg-bienvenida .pg-disco { width: 64px; height: 64px; flex: none; background: #fff; border: 3px dashed var(--pg-sun); box-shadow: 0 0 0 3px #FFF8E6, 0 0 0 5px var(--pg-sun); transform: rotate(-6deg); }
.pg-bienvenida .pg-disco img { width: 46px; }
.pg-bienvenida b { font: 600 1rem var(--pg-d); display: block; }

/* sello nuevo */
.pg-nuevo-sello { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 12px; }
.pg-burst { position: relative; width: 220px; height: 220px; display: grid; place-items: center; margin: 4px 0 8px; }
.pg-burst svg { position: absolute; inset: 0; animation: pg-gira 24s linear infinite; }
@keyframes pg-gira { to { transform: rotate(360deg); } }
.pg-grande { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: var(--cs); border: 4px dashed var(--c); box-shadow: 0 0 0 7px #fff, 0 0 0 10px var(--c); transform: rotate(-7deg); animation: pg-pop .55s cubic-bezier(.2, 1.6, .4, 1); }
.pg-grande .pg-cara { width: 118px; height: 118px; border: 0; box-shadow: none; }
.pg-grande img.pg-sol-grande { width: 100px; }
@keyframes pg-pop { from { transform: scale(1.8) rotate(-20deg); opacity: 0; } }
.pg-insignia { display: inline-block; background: var(--pg-hueco); color: #fff; font: 800 .72rem var(--pg-b); letter-spacing: .12em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; }
.pg-dijo { font-family: var(--pg-h); font-weight: 700; font-size: 1.6rem; line-height: 1.15; color: #6b3f1f; margin: 6px 4px 4px; display: block; }

/* constelación */
.pg-noche { background: linear-gradient(180deg, #2F2350 0%, #4B3470 60%, #7A4E7E 100%); color: #fff; border-radius: 22px; padding: 16px 14px 14px; position: relative; overflow: hidden; }
.pg-noche h4 { font: 600 1.3rem var(--pg-d); text-align: center; margin: 0; }
.pg-noche p { margin: 4px 0 8px; text-align: center; font-size: .84rem; opacity: .85; }
.pg-cielo { position: relative; height: 230px; }
.pg-cielo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg-cielo .pg-cara { position: absolute; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 18px 4px rgba(255,220,140,.55); }
.pg-cielo .pg-cnt { position: absolute; transform: translate(-50%, 0); font: 700 .72rem var(--pg-b); color: #FFE7A8; white-space: nowrap; }
.pg-diploma { margin-top: 12px; border-radius: 20px; background: #fff; border: 3px double var(--pg-sun); text-align: center; padding: 12px 12px 14px; }
.pg-diploma img.pg-g { border-radius: 14px; margin-bottom: 8px; width: 100%; display: block; }
.pg-guardados { margin: 14px 0 0; font-size: .82rem; color: var(--pg-muted); }

@media (prefers-reduced-motion: reduce) { .pg-burst svg, .pg-grande { animation: none; } }

/* ---- cierre de sesión (equipo): una pantalla para uno o varios peques ---- */
.pg-cierre-capa { position: fixed; inset: 0; z-index: 90; background: rgba(59,36,24,.5); display: flex; align-items: flex-end; justify-content: center; }
.pg-cierre-capa[hidden] { display: none; }
.pg-cierre { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--pg-paper); border-radius: 22px 22px 0 0; border: 2px solid var(--pg-line); }
@media (min-width: 640px) { .pg-cierre-capa { align-items: center; } .pg-cierre { border-radius: 22px; } }
.pg-cierre-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; background: var(--pg-sun-soft); position: sticky; top: 0; z-index: 2; }
.pg-cierre-cab strong { font: 600 1rem var(--pg-d); }
.pg-fila { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; padding: 12px 16px; border-top: 1px solid var(--pg-line); }
.pg-fila .pg-nm { font: 600 1.02rem var(--pg-d); }
.pg-fila .pg-nm span { display: block; font: 600 .74rem var(--pg-b); color: var(--pg-muted); }
.pg-fila .pg-quitar { margin-top: 4px; border: 0; background: none; color: var(--pg-hueco); font: 700 .75rem var(--pg-b); text-decoration: underline; padding: 6px 0; text-align: left; min-height: 32px; }
.pg-fila.pg-fuera { opacity: .5; }
.pg-elige { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-pick { border: 0; background: none; padding: 2px; border-radius: 50%; }
.pg-pick .pg-cara { width: 46px; height: 46px; filter: grayscale(1); opacity: .45; transition: .15s; }
.pg-pick[aria-pressed=true] .pg-cara { filter: none; opacity: 1; transform: scale(1.12) rotate(-5deg); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.pg-frases { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-frases button { border: 2px solid var(--pg-line); background: var(--pg-paper); border-radius: 99px; padding: 6px 12px; font: 600 .8rem var(--pg-b); text-align: left; min-height: 36px; }
.pg-frases button[aria-pressed=true] { background: var(--pg-ink); border-color: var(--pg-ink); color: #fff; }
.pg-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--pg-line); background: #FBF4E8; position: sticky; bottom: 0; }
.pg-pie .pg-aviso { font-size: .78rem; color: var(--pg-muted); flex: 1 1 200px; }
.pg-ya { grid-column: 2; font-size: .82rem; color: #2f7a4f; font-weight: 700; }
@media (max-width: 480px) { .pg-fila { grid-template-columns: 1fr; } .pg-frases, .pg-ya { grid-column: 1; } }

/* ---- la ficha del niño (equipo) ---- */
.pg-ficha .pg-fch-fila { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--pg-line); }
.pg-ficha .pg-fch-fila .pg-cara { width: 34px; height: 34px; }
.pg-ficha .pg-fch-fila.pg-anulado { opacity: .55; text-decoration: line-through; }
.pg-ficha .pg-fch-fila .pg-quien { font-size: 11px; color: var(--pg-muted); }
.pg-ficha .pg-anular { margin-left: auto; border: 1px solid #e3b8b0; color: #a33a2a; background: #fff; border-radius: 10px; padding: 4px 10px; font-size: 11px; font-weight: 700; min-height: 32px; }
.pg-ficha .pg-eq { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.pg-ficha .pg-eq button { border: 0; background: none; padding: 2px; border-radius: 50%; }
.pg-ficha .pg-eq .pg-cara { width: 40px; height: 40px; filter: grayscale(1); opacity: .45; }
.pg-ficha .pg-eq button[aria-pressed=true] .pg-cara { filter: none; opacity: 1; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
