body { min-height: 100vh; min-height: 100svh; background: #0a0418; }
#app { position: relative; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100svh; background: var(--noche); overflow-x: hidden; }
@media (min-width: 520px) { #app { box-shadow: 0 0 0 2px var(--linea), 0 0 80px rgba(255,46,147,.18); } }

.p { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 22px 20px calc(28px + env(safe-area-inset-bottom)); }
.p > * { position: relative; z-index: 1; }
.p > .escena { position: absolute; z-index: 0; }
.barra { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 8px; }
.atras { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--suave); font-weight: 600; padding: 8px 4px; background: none; border: 0; cursor: pointer; }
h2.t { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; margin: 6px 0 8px; }
.sub { color: var(--suave); font-size: 1rem; }

/* Portada */
.portada { padding-top: 34px; }
.portada .escena { --h: 71%; --d: min(290px, 72vw); }
.portada .marca small { display: block; font-weight: 600; color: var(--suave); font-size: .95rem; }
.portada h1 { font-family: var(--display-inline); font-size: clamp(3.4rem, 17vw, 4.8rem); line-height: .9; margin-top: 10px; }
.portada h1 span { display: block; font-size: 1.28em; }
.portada .texto { margin-top: 16px; max-width: 26ch; font-size: 1.05rem; text-shadow: 0 2px 10px rgba(10,4,24,.9); }
.portada .acciones { margin-top: auto; display: grid; gap: 14px; padding-top: 250px; }
.portada .acciones > * { position: relative; }
.portada .acciones::before { content: ""; position: absolute; z-index: -1; left: -20px; right: -20px; top: 215px; bottom: -28px; background: linear-gradient(rgba(10,4,24,0), rgba(10,4,24,.8) 30%, rgba(10,4,24,.92) 100%); }
.portada .acciones .btn { min-height: 66px; font-size: 1.2rem; background-clip: padding-box; }
.portada .acciones .btn-cian { background: rgba(18,8,38,.78); backdrop-filter: blur(4px); }
.portada .acciones .btn-magenta { border-color: #ffd6ec; box-shadow: 0 0 0 3px rgba(10,4,24,.9), 0 0 30px rgba(255,46,147,.6), inset 0 -4px 0 rgba(0,0,0,.18); }
.portada .estado { margin-top: 18px; text-align: center; }

/* Formulario */
.foto-caja { position: relative; aspect-ratio: 4/5; margin: 14px auto 10px; width: min(100%, 288px); border-radius: 18px; overflow: hidden; border: 3px dashed var(--magenta); background: var(--noche-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.foto-caja.lista { border-style: solid; border-color: var(--cian); box-shadow: 0 0 28px rgba(45,226,230,.35); }
.foto-caja .vacio { display: grid; gap: 10px; justify-items: center; color: var(--suave); text-align: center; padding: 20px; }
.foto-caja .vacio svg { width: 54px; height: 54px; color: var(--magenta); }
.foto-caja .vacio b { font-family: var(--display); color: var(--texto); font-size: 1.15rem; font-weight: 400; }
.foto-caja img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.foto-caja .rehacer { position: absolute; right: 10px; bottom: 10px; background: rgba(18,8,38,.85); border: 1px solid var(--linea); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .9rem; }
.galeria { display: block; text-align: center; margin: 0 0 16px; color: var(--cian); font-weight: 600; background: none; border: 0; cursor: pointer; width: 100%; padding: 8px; text-decoration: underline; }
.campo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 600; }
.campo label small { color: var(--suave); font-weight: 400; margin-left: 6px; }
.campo input { width: 100%; min-height: 54px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--linea); background: var(--noche-2); font-size: 1.05rem; }
.campo input::placeholder { color: #7f70b8; }
.campo input:focus { border-color: var(--cian); outline: none; box-shadow: 0 0 0 3px rgba(45,226,230,.25); }
.aviso { color: var(--suave); font-size: .92rem; margin: 2px 0 16px; }
.error { color: var(--alerta); background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.4); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }

/* Mensajes */
.centro { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; gap: 14px; padding: 20px 4px; }
.centro h2 { font-family: var(--display); font-size: 1.8rem; line-height: 1.1; }
.centro p { color: var(--suave); max-width: 30ch; }
.centro .btn { width: 100%; margin-top: 8px; }
.sello { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; border: 3px solid currentColor; box-shadow: 0 0 30px currentColor, inset 0 0 30px color-mix(in srgb, currentColor 30%, transparent); }
.sello svg { width: 56px; height: 56px; }
.miniatura { width: 132px; aspect-ratio: 4/5; border-radius: 16px; overflow: hidden; border: 3px solid var(--cian); position: relative; box-shadow: 0 0 28px rgba(45,226,230,.35); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.miniatura.revisando::after { content: ""; position: absolute; left: 0; right: 0; height: 36%; top: -40%; background: linear-gradient(transparent, rgba(45,226,230,.55), transparent); animation: barrido 2.2s ease-in-out infinite; }
@keyframes barrido { to { top: 110%; } }

/* Votar */
.votar { padding: 0; }
.votar .cab { padding: 22px 20px 12px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--noche) 85%, transparent); }
.buscar { width: 100%; min-height: 48px; padding: 0 16px; margin-top: 12px; border-radius: 999px; border: 2px solid var(--linea); background: var(--noche-2); }
.buscar:focus { border-color: var(--cian); outline: none; }
.grilla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 16px; }
.carta { position: relative; border-radius: 16px; overflow: hidden; border: 3px solid var(--linea); background: var(--panel); text-align: left; padding: 0; cursor: pointer; transition: transform .12s, border-color .15s, box-shadow .2s; display: block; width: 100%; }
.carta { aspect-ratio: 4/5; }
.carta .foto { position: absolute; inset: 0; background: var(--noche-2); }
.carta .foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.carta .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 11px 10px; background: linear-gradient(rgba(10,4,24,0), rgba(10,4,24,.88) 55%, rgba(10,4,24,.96)); }
.carta b { display: block; font-family: var(--display); font-weight: 400; font-size: 1rem; line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 2px 8px #000; }
.carta span.d { display: block; color: #d9cdf7; font-size: .82rem; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.2; }
.carta[aria-pressed="true"] { border-color: var(--cian); box-shadow: 0 0 0 2px rgba(45,226,230,.35), 0 0 28px rgba(45,226,230,.55); transform: translateY(-2px); }
.carta[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: var(--cian); color: #12082a; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.carta .marca-v { position: absolute; top: 8px; left: 8px; background: var(--magenta); color: #1d0630; font-weight: 700; font-size: .78rem; padding: 3px 9px; border-radius: 999px; }
.carta.propia { opacity: .55; cursor: not-allowed; border-style: dashed; }
.carta.propia .foto { filter: grayscale(.6); }
.carta.suyo { border-color: var(--sol); }
.sin-res { grid-column: 1/-1; text-align: center; color: var(--suave); padding: 30px 10px; }
.votar .barra-voto { position: sticky; bottom: 0; margin-top: auto; z-index: 8; padding: 30px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--noche) 40%); transform: translateY(110%); opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .2s ease, visibility 0s .25s; pointer-events: none; }
.votar .barra-voto.on { transform: none; opacity: 1; visibility: visible; transition: transform .25s ease, opacity .2s ease; pointer-events: auto; }
.barra-voto p { text-align: center; color: var(--suave); font-size: .9rem; margin-bottom: 8px; }
.barra-voto .btn { width: 100%; }

/* ---------- Pantalla en vivo (versión celular) ---------- */
.vivo { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.vivo-acciones { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 12px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: linear-gradient(var(--noche) 80%, rgba(18,8,38,0)); }
.vivo-acciones:empty { display: none; }
.vivo-acciones .btn { min-height: 54px; font-size: .95rem; padding: 0 10px; }
.vivo-acciones .btn-cian { background: rgba(18,8,38,.78); }
.vivo-cab { text-align: center; padding: 8px 0 14px; }
.vivo-cab small { display: block; color: var(--suave); font-weight: 600; }
.vivo-cab h1 { font-family: var(--display-inline); font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1; margin: 4px 0 8px; }
.panel-vivo { position: relative; min-height: 320px; border-radius: 20px; border: 2px solid var(--linea); background: radial-gradient(500px 260px at 50% 0, rgba(123,92,255,.28), transparent 70%), rgba(26,14,58,.85); padding: 16px 14px 18px; overflow: hidden; }
.panel-vivo > * { animation: v-entra .45s ease-out both; }
@keyframes v-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.v-msj { text-align: center; display: grid; gap: 10px; padding: 26px 6px; justify-items: center; }
.v-msj h3, .v-tit { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.15; }
.v-msj p { color: var(--suave); max-width: 28ch; }
.v-tit { text-align: center; margin-bottom: 12px; }
.v-eq { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 70px; margin-top: 6px; }
.v-eq i { width: 10px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--cian), var(--magenta)); animation: v-eq 1.1s ease-in-out infinite alternate; }
@keyframes v-eq { from { height: 8px; } to { height: 70px; } }
.v-total b { font-family: var(--display); font-weight: 400; color: var(--sol); }

.v-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.v-cuenta { color: var(--suave); font-weight: 600; }
.v-lista { list-style: none; padding: 0; display: grid; gap: 10px; }
.v-fila { display: grid; grid-template-columns: 34px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(36,21,82,.9); border: 2px solid var(--linea); }
.v-fila .v-pos { font-family: var(--display); font-size: 1.5rem; text-align: center; }
.v-fila .v-ft { width: 48px; aspect-ratio: 4/5; border-radius: 8px; overflow: hidden; }
.v-fila .v-ft img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.v-fila .v-tx { min-width: 0; line-height: 1.15; }
.v-fila .v-tx b { display: block; font-family: var(--display); font-weight: 400; font-size: .98rem; overflow-wrap: anywhere; }
.v-fila .v-tx small { display: block; color: var(--suave); overflow-wrap: anywhere; }
.v-fila .v-vt { font-family: var(--display); font-size: 1.2rem; color: var(--cian); }
.v-fila .v-emp { font-size: .72rem; font-weight: 700; color: var(--sol); border: 1px solid var(--sol); border-radius: 99px; padding: 1px 8px; }
.v-barra { display: block; height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); margin-top: 6px; overflow: hidden; }
.v-barra u { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--cian)); box-shadow: 0 0 10px var(--c, var(--cian)); transition: width .8s ease; }
.v-fila.p1, .v-fila.t1 { --c: var(--sol); border-color: var(--sol); } .v-fila.p1 .v-pos, .v-fila.t1 .v-pos { color: var(--sol); }
.v-fila.p2, .v-fila.t2 { --c: var(--cian); border-color: var(--cian); } .v-fila.p2 .v-pos, .v-fila.t2 .v-pos { color: var(--cian); }
.v-fila.p3, .v-fila.t3 { --c: var(--magenta); border-color: var(--magenta); } .v-fila.p3 .v-pos, .v-fila.t3 .v-pos { color: var(--magenta); }
.v-lista.compacta { gap: 7px; }
.v-lista.compacta .v-fila { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 7px 10px; }

.v-susp { text-align: center; padding: 40px 6px; display: grid; gap: 8px; }
.v-susp p { color: var(--suave); font-size: 1.1rem; font-weight: 600; }
.v-susp h3 { font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1.1; }
.v-puntos span { animation: v-parp 1.2s infinite; } .v-puntos span:nth-child(2) { animation-delay: .25s; } .v-puntos span:nth-child(3) { animation-delay: .5s; }
@keyframes v-parp { 0%, 60% { opacity: 1; } 80% { opacity: .1; } }

.v-puesto, .v-part, .v-gana { display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.v-puesto.t { --c: var(--magenta); } .v-puesto.s { --c: var(--cian); } .v-part { --c: var(--sol); } .v-gana { --c: var(--sol); }
.v-etiq { font-family: var(--display); font-size: 1.5rem; color: var(--c); text-shadow: 0 0 18px var(--c); }
.v-retrato { position: relative; width: min(64%, 250px); aspect-ratio: 4/5; border-radius: 18px; overflow: hidden; border: 5px solid var(--c); box-shadow: 0 0 34px var(--c); background: var(--noche-2); }
.v-retrato.g { width: min(72%, 280px); border-width: 6px; box-shadow: 0 0 50px var(--sol), 0 0 24px var(--magenta); }
.v-retrato img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.v-medalla { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #1d0630; display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; border: 3px solid #fff; }
.v-nombre { font-family: var(--display); font-size: 1.7rem; line-height: 1.05; overflow-wrap: anywhere; }
.v-nombre.g { font-size: 2rem; color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--magenta), 0 0 40px var(--magenta); }
.v-dis { font-size: 1.1rem; color: #d9cdf7; font-weight: 600; overflow-wrap: anywhere; }
.v-dis.g { color: var(--cian); }
.v-vot { color: var(--suave); } .v-vot b { color: var(--texto); }
.v-cont { color: var(--suave); font-size: .9rem; }
.v-gtit { font-family: var(--display-shade); font-size: 2.2rem; color: var(--sol); text-shadow: 0 0 22px rgba(255,178,31,.8); line-height: 1; }
#v-conf { position: absolute; inset: -16px -14px; width: calc(100% + 28px); height: calc(100% + 34px); pointer-events: none; z-index: 2; }
.v-part { cursor: pointer; }

/* Nombres sin espacios: que nunca desborden la pantalla del celular */
.voto-a, .barra-voto .btn, .carta .info b { overflow-wrap: anywhere; }
