/* Superpoderes: el juego de cartas de la feria. Tokens, botones, pestañas y aviso vienen de ../styles.css */
[data-tono="claro"] { --on: var(--blanco); }
[data-tono="oscuro"] { --on: var(--tinta); }

.sp-main { width: min(100% - 32px, 1080px); margin-inline: auto; padding: 28px 0 64px; outline: 0; }
.sp-h1 { font-size: clamp(2.1rem, 8vw, 3.6rem); font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: -.02em; margin: 8px 0 14px; text-wrap: balance; }
.sp-h2 { font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.lead { font-family: var(--serif); font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.nota { font-size: .85rem; color: var(--muted); }
.sp-intro { margin-bottom: 28px; }
.sp-panel { max-width: 560px; }
.aviso { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--naranja); font-weight: 600; }
.vacio { padding: 24px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

/* Formulario */
.sp-form { display: grid; gap: 22px; }
.sp-form--una { margin-top: 24px; }
.campo { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo > span, .campo legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.campo > span { margin-bottom: 0; }
.campo small { display: block; font-weight: 500; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.campo input, .campo select {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: 500 1rem var(--sans);
}
.campo input:focus, .campo select:focus { border-color: var(--text); }
.codigo { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; max-width: 240px; font-weight: 700 !important; }
.campo-par { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
.error { color: var(--vino); font-weight: 600; min-height: 1.2em; }
:root[data-theme="dark"] .error { color: #E7849F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .error { color: #E7849F; } }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-link { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--text); font: 600 .95rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link--peligro { color: var(--vino); }
:root[data-theme="dark"] .btn-link--peligro { color: #E7849F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-link--peligro { color: #E7849F; } }
.peligro { border-top: 1px solid var(--line); padding-top: 16px; }
button.btn--ghost { background: none; }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }

.poderes { display: flex; flex-wrap: wrap; gap: 8px; }
.poder {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font: 600 .92rem var(--sans); cursor: pointer; transition: transform .15s ease;
}
.poder:active { transform: scale(.96); }
.poder__punto { width: 24px; height: 24px; border-radius: 50%; background: var(--c); flex: none; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.poder[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--on); }
.poder[aria-pressed="true"] .poder__punto { background: var(--on); color: var(--c); }

/* Vista previa: entre los poderes y la frase en el celular; a un lado, fija, en pantallas anchas */
.sp-vista .eyebrow { text-align: center; margin-bottom: 12px; }
.sp-vista .carta { width: min(100%, 250px); }
@media (min-width: 860px) {
  .sp-form:not(.sp-form--una) { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 56px; align-items: start; }
  .sp-form > :not(.sp-vista) { grid-column: 1; }
  .sp-vista { grid-column: 2; grid-row: 1 / span 9; position: sticky; top: 96px; }
  .sp-vista .carta { width: 100%; }
}

/* La carta coleccionable */
.carta {
  position: relative; isolation: isolate; width: min(100%, 300px); aspect-ratio: 5 / 7; margin-inline: auto;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: var(--surface); color: var(--text); border: 2px solid var(--text); box-shadow: 6px 6px 0 var(--text);
}
.carta__banda {
  display: flex; justify-content: space-between; gap: 8px; padding: 11px 14px; background: var(--c); color: var(--on);
  font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; border-bottom: 2px solid var(--text);
}
.carta__cara {
  flex: 1; display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--c) 26%, transparent), transparent 68%),
    repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--text) 5%, transparent) 9px 18px);
}
.carta__inicial {
  width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--on);
  font: 800 clamp(2.4rem, 13vw, 3.6rem)/1 var(--sans); box-shadow: 0 0 0 6px var(--surface), 0 0 0 8px var(--c);
}
.carta__info { display: grid; gap: 4px; padding: 12px 14px 14px; border-top: 2px solid var(--text); }
.carta__titulo { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .98rem; }
.carta__nombre { font-size: 1.45rem; font-weight: 800; text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.carta .chips { margin-top: 6px; }
.carta > .ods-bar { height: 6px; gap: 0; }
/* Brillo holográfico: una franja iridiscente que cruza la carta */
.carta::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, .7) 42%, rgba(253, 157, 36, .45) 47%, rgba(64, 127, 70, .35) 52%, rgba(31, 73, 125, .4) 57%, transparent 70%);
  background-size: 260% 100%; animation: holo 5s ease-in-out infinite;
}
@keyframes holo { 0% { background-position: 120% 0; } 55%, 100% { background-position: -40% 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; }
.chip { background: var(--c); color: var(--on); border-radius: 999px; padding: 3px 9px; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Pantalla principal */
.juego { display: grid; gap: 28px; }
.mia .carta { width: min(100%, 240px); }
.mia__acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.mia__nota { text-align: center; margin-top: 10px; }
.sp-tabs { position: sticky; top: 72px; z-index: 5; margin: 0 -16px 14px; padding: 8px 16px; background: var(--bg); }
.sp-tabs button { flex: 1 1 auto; padding: 0 10px; font-size: .88rem; white-space: nowrap; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--vino); color: var(--blanco); font-size: .72rem; font-weight: 800; }
@media (min-width: 900px) {
  .juego { grid-template-columns: 300px minmax(0, 1fr); gap: 56px; align-items: start; }
  .mia { position: sticky; top: 96px; }
  .mia .carta { width: 100%; }
  .sp-tabs { margin-inline: 0; padding-inline: 0; }
}

/* Mis matches */
.matches { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.match {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.match--nueva { border: 2px solid var(--vino); }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--on); font-weight: 800; font-size: 1.3rem; }
.match h3 { font-size: 1.15rem; font-weight: 800; }
.match__meta { font-size: .88rem; margin: 2px 0 8px; }
.match h3 + .chips { margin-top: 8px; }
.match__frase { font-family: var(--serif); font-style: italic; margin-top: 10px; }
.match__por { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.match__por b { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.match__accion { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.estado { font-size: .92rem; }
.estado--ok { color: var(--verde); font-weight: 700; }
:root[data-theme="dark"] .estado--ok { color: #8BC492; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .estado--ok { color: #8BC492; } }

/* Mi álbum */
.cuenta { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
#pane > .sp-h2 + .nota { margin: 4px 0 0; }
#pane > .album + .sp-h2 { margin-top: 32px; }
.album { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .album { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hueco, .lleno {
  position: relative; min-height: 172px; padding: 14px 10px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: .85rem;
}
.hueco { border: 2px dashed var(--line); color: var(--muted); font-weight: 600; }
.hueco--obj svg { width: 56px; height: 56px; color: var(--line); }
.hueco--obj b { font-size: 1.1rem; }
.lleno { background: var(--surface); border: 2px solid var(--text); box-shadow: 3px 3px 0 var(--text); }
.lleno b { font-size: .98rem; overflow-wrap: anywhere; }
.lleno--obj svg { width: 60px; height: 60px; color: var(--c); }
.lleno__titulo { font-family: var(--serif); font-style: italic; color: var(--muted); }
.lleno__fusion { font-size: .78rem; font-weight: 600; }
.lleno__correo { font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.compartir { margin-top: 4px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: none; color: var(--text); font: 600 .76rem var(--sans); cursor: pointer; }
.compartir[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: var(--blanco); }
.nuevo { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.nuevo::before {
  content: "¡nuevo!"; position: absolute; top: -10px; right: -6px; z-index: 1; padding: 4px 9px; border-radius: 999px;
  background: var(--vino); color: var(--blanco); font-size: .72rem; font-weight: 800; transform: rotate(8deg);
}
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }

/* Premio */
.premio { display: grid; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--text); box-shadow: 4px 4px 0 var(--text); }
.premio--dentro { background: var(--amarillo); color: var(--tinta); border-color: var(--tinta); box-shadow: 4px 4px 0 var(--tinta); }
.meta { display: grid; gap: 6px; }
.meta__fila { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; }
.barra { height: 14px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid currentColor; overflow: hidden; }
.premio--dentro .barra { background: var(--papel); }
.barra i { display: block; height: 100%; background: var(--c); transition: width .6s ease; }
.boletos { font-size: 1.1rem; }
.bonus { margin: 20px 0 12px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface-2); display: grid; gap: 6px; }
.bonus h3 { font-size: 1.05rem; font-weight: 800; }

.sp-pie { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: center; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; }
.sp-pie a { font-weight: 600; }

/* QR de mi carta */
.qr { width: min(100% - 32px, 380px); border: 0; border-radius: 24px; padding: 24px; background: var(--surface); color: var(--text); text-align: center; }
.qr::backdrop { background: rgb(22 22 20 / .72); }
.qr h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.qr__img { width: min(100%, 300px); margin: 16px auto 10px; padding: 10px; border-radius: 16px; background: #fff; aspect-ratio: 1; display: grid; place-items: center; }
.qr__img svg { width: 100%; height: auto; display: block; }
.qr .btn { margin-top: 16px; width: 100%; }

.toast { left: 16px; right: 16px; margin-inline: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; }

/* Páginas de texto: privacidad y panel del equipo */
.texto { max-width: 720px; }
.texto h2 { font-size: 1.2rem; font-weight: 800; margin: 28px 0 8px; }
.texto p, .texto li { line-height: 1.6; }
.texto ul { padding-left: 1.2em; }
