/* ScriptBattle · ranking del reto con el MISMO lenguaje pixel art de la «Tabla de puestos» del Aula (/aula/).
   Mismas fuentes autoalojadas (Pixelify Sans + Press Start 2P), tokens, marco con esquinas recortadas,
   avatar identicon 5×5 y medallas oro/plata/bronce. Lo usan la portada (top 3) y /clases/. 7-nov-2026. */
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/pixelify-sans-latin-wght-normal-Cbhn5ptY.woff2") format("woff2"); }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF;
  src: url("/assets/pixelify-sans-latin-ext-wght-normal-CsF3XSp0.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/press-start-2p-latin-400-normal-_wFEWmAB.woff2") format("woff2"); }

.pz {
  --night: #0b0713; --night-950: #080512;
  --panel: #14101f; --panel-90: #14101fe6; --panel-light: #1d1730;
  --edge: #2c2150;
  --text-body: #cbc6df; --text-muted: #9d96b8; --text-strong: #fff;
  --arcane-300: #c4b5fd; --arcane-400: #a78bfa;
  --gold-300: #f8d47a; --gold-400: #f5c451; --gold-600: #b78a1e;
  --rune-300: #7dd3fc; --rune-400: #38bdf8;
  --spell-400: #4ade80; --ember-400: #f87171;
  --pista: #241b3a;
  --pixel: "Pixelify Sans", ui-sans-serif, system-ui, sans-serif;
  --arcade: "Press Start 2P", ui-monospace, monospace;
  color: var(--text-body); font-family: var(--pixel);
}
.pz .clip-corner { clip-path: polygon(0 12px,6px 12px,6px 6px,12px 6px,12px 0,calc(100% - 12px) 0,calc(100% - 12px) 6px,calc(100% - 6px) 6px,calc(100% - 6px) 12px,100% 12px,100% calc(100% - 12px),calc(100% - 6px) calc(100% - 12px),calc(100% - 6px) calc(100% - 6px),calc(100% - 12px) calc(100% - 6px),calc(100% - 12px) 100%,12px 100%,12px calc(100% - 6px),6px calc(100% - 6px),6px calc(100% - 12px),0 calc(100% - 12px)); }

/* panel exterior: marco degradado + fondo nocturno con brillos, como el Aula */
.pz-marco { padding: 3px; background: linear-gradient(135deg, #8b5cf6aa, #0ea5e966); filter: drop-shadow(0 10px 0 #0a0d1c); }
.pz-panel { position: relative; padding: clamp(18px, 2.6vw, 30px) clamp(14px, 2.6vw, 30px);
  background: radial-gradient(60% 50% at 0% 0%, #7c3aed30, transparent 60%),
              radial-gradient(50% 40% at 100% 0%, #0ea5e924, transparent 60%), var(--night); }

.pz-cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; margin-bottom: clamp(14px, 2vw, 22px); }
.pz-cejilla { display: inline-flex; align-items: center; gap: 10px; font-family: var(--arcade); font-size: clamp(9px, 1vw, 11px); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); }
.pz-cejilla i { width: 6px; height: 6px; background: var(--gold-400); flex: none; }
.pz-titulo { margin: 8px 0 0; font-family: var(--pixel); font-weight: 600; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.1; color: var(--text-strong); text-shadow: none; }
.pz-vivo { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 2px solid #15803d99; font-family: var(--arcade); font-size: clamp(8px, .9vw, 10px); letter-spacing: .14em; text-transform: uppercase; color: var(--spell-400); }
.pz-vivo::before { content: ""; width: 8px; height: 8px; background: var(--spell-400); }
.pz-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-family: var(--arcade); font-size: clamp(7px, .8vw, 9px); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.pz-sub [data-ranking-jugando] { color: var(--spell-400); }

/* ── marcador ── */
.pz .rk-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(6px, 1vw, 10px); font-size: clamp(13px, 1.5vw, 18px); }
.puesto { position: relative; padding: 2px; background: linear-gradient(135deg, var(--edge), #6d28d966); }
.puesto.top1 { background: linear-gradient(135deg, var(--gold-400), #b78a1e66); }
.puesto.top2 { background: linear-gradient(135deg, #d7dbe7, #8f96a866); }
.puesto.top3 { background: linear-gradient(135deg, #e0a06a, #9c5f2c66); }
.puesto .dentro { display: grid; grid-template-columns: 2.6em 3em minmax(0, 1fr) auto auto auto; align-items: center;
  gap: clamp(8px, 1.4vw, 18px); padding: .55em .9em .55em .7em; background: var(--panel-90); border-left: 6px solid var(--c, var(--edge)); }
.puesto.top1 .dentro { background: linear-gradient(90deg, #f5c45124, var(--panel-90) 45%); }
.rango { display: grid; place-items: center; width: 2.2em; height: 2.2em; font-family: var(--arcade); font-size: .85em;
  background: var(--panel-light); color: var(--text-body); border: 2px solid var(--edge); box-shadow: 2px 2px 0 0 #03020899; }
.top1 .rango { background: var(--gold-400); color: #1a1205; border-color: var(--gold-600); font-size: 1em; }
.top2 .rango { background: #d7dbe7; color: #1a1a2a; border-color: #8f96a8; }
.top3 .rango { background: #e0a06a; color: #2b1808; border-color: #9c5f2c; }
.avatar { width: 3em; height: 3em; display: block; background: var(--night-950); border: 2px solid var(--c, var(--edge)); image-rendering: pixelated; }
.avatar rect { fill: var(--c, var(--arcane-400)); }
.quien-es { min-width: 0; display: flex; flex-direction: column; gap: .35em; }
.apodo { font-family: var(--pixel); font-weight: 600; font-size: 1.35em; color: var(--text-strong); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; gap: .45em; flex-wrap: wrap; align-items: center; }
.etq { display: inline-flex; align-items: center; gap: .4em; padding: .3em .55em; border: 2px solid var(--edge); background: #0b0713d9; color: var(--text-body);
  font-family: var(--arcade); font-size: clamp(7px, .5em, 10px); letter-spacing: .06em; white-space: nowrap; text-transform: uppercase; }
.etq.runa { border-color: #0ea5e999; color: var(--rune-400); }
.etq.oro { border-color: #b78a1e99; color: var(--gold-400); }
.etq.vivo { border-color: #15803d99; color: var(--spell-400); }
.etq.vivo::before { content: ""; width: .7em; height: .7em; background: var(--spell-400); }
.etq.gris { color: var(--text-muted); }
.etq.sube { border-color: #15803d; background: #15803d; color: #fff; }
.etq.baja { border-color: #b91c1c; background: #7f1d1d; color: #fff; }
.col { text-align: right; font-variant-numeric: tabular-nums; min-width: 4.2em; }
.col b { display: block; font-family: var(--pixel); font-size: 1.3em; font-weight: 700; color: var(--text-strong); line-height: 1; }
.col small { display: block; margin-top: .5em; font-family: var(--arcade); font-size: .48em; letter-spacing: .12em; color: var(--text-muted); text-transform: uppercase; }
.col.merito { min-width: 6em; }
.col.merito b { font-size: 1.9em; color: var(--gold-300); letter-spacing: -.01em; }
.col.acierto b { color: var(--spell-400); }
.medidor { display: block; height: .35em; width: 6em; margin: .45em 0 0 auto; background: var(--pista); overflow: hidden; }
.medidor i { display: block; height: 100%; background: var(--rune-400); }
.top1 .medidor i { background: var(--gold-400); }
.movil { display: none; }
.pz .rk-vacio { padding: 20px; text-align: center; color: var(--text-muted); border: 2px dashed var(--edge); font-family: var(--pixel); font-size: 1.05em; }
.pz-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; }
.pz-nota { margin: 0; font-family: var(--pixel); font-size: 15px; color: var(--text-muted); }
.pz-ver { font-family: var(--arcade); font-size: clamp(9px, 1vw, 11px); letter-spacing: .1em; text-transform: uppercase; color: #0b0713; background: var(--rune-400); padding: 10px 12px; box-shadow: 3px 3px 0 0 #03020899; white-space: nowrap; }

/* filtros (/clases/) */
.pz-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pz-filtros button { font-family: var(--arcade); font-size: clamp(8px, .9vw, 10px); letter-spacing: .08em; text-transform: uppercase; padding: 9px 11px; border: 2px solid var(--edge); background: var(--panel); color: var(--arcane-300); cursor: pointer; }
.pz-filtros button:hover { background: var(--panel-light); }
.pz-filtros button[aria-pressed="true"] { border-color: var(--gold-400); color: var(--gold-300); }

@media (max-width: 640px) {
  .pz .rk-lista { font-size: 13px; }
  .puesto .dentro { grid-template-columns: 2.4em 2.6em minmax(0, 1fr) auto; gap: 9px; padding: .55em .6em .55em .5em; border-left-width: 4px; }
  .avatar { width: 2.6em; height: 2.6em; }
  .col.acierto, .col.niveles { display: none; }
  .col.merito { min-width: 0; }
  .col.merito b { font-size: 1.6em; }
  .medidor { width: 4.2em; }
  .movil { display: inline-flex; }
  .apodo { font-size: 1.25em; }
}

/* portada: el panel entero es un enlace a /clases/ */
a.rk-top { display: block; text-decoration: none; margin-bottom: clamp(40px, 5vw, 60px); }
a.rk-top:focus-visible { outline: 3px solid var(--celeste, #00ceff); outline-offset: 6px; }
@media (prefers-reduced-motion: no-preference) {
  a.rk-top .pz-marco { transition: transform .22s cubic-bezier(.2, 0, 0, 1); }
  a.rk-top:hover .pz-marco { transform: translate(-3px, -3px); }
  .pz-vivo::before, .etq.vivo::before { animation: pz-parpadeo 1s steps(2, jump-none) infinite; }
  @keyframes pz-parpadeo { 50% { opacity: .2; } }
  .etq.sube, .etq.baja { animation: pz-entra .45s steps(4) both; }
  @keyframes pz-entra { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
  .puesto.top1 { animation: pz-brillo 2.8s ease-in-out infinite alternate; }
  @keyframes pz-brillo { from { filter: drop-shadow(0 0 0 #f5c45100); } to { filter: drop-shadow(0 0 12px #f5c45166); } }
}
