/* =====================================================================
   v5 · reproductor de video, bienvenida para teléfonos (instalar app)
   y el evento "Erika en directo" (simulado). Se carga después de v2.css.
   ===================================================================== */

/* ---------------- Reproductor ---------------- */
.modal.video { gap: .35em; }
.v-head .v-x { min-width: 2.2em; min-height: 1.9em; }
.v-stage { position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; background: transparent; }
.v-box { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px #ffffff14, 0 12px 40px #0009; }
@supports (width: 1cqw) { .v-box { width: min(100cqw, 100cqh * 16 / 9); } }
.v-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; display: block; cursor: pointer; }
.modal.video.idle .v-box, .modal.video.idle .v-box canvas { cursor: none; }

/* subtítulos: suben cuando aparecen los controles */
.v-box .v-sub { bottom: 3%; transition: bottom .25s ease, opacity .2s; }
.modal.video:not(.idle) .v-box .v-sub { bottom: calc(3.9em + 2%); }
.modal.video.quiz .v-box .v-sub { opacity: 0; }

/* botón grande al pausar */
.v-big { left: 50%; top: 50%; transform: translate(-50%, -50%); border: 2px solid #ffffff44; padding: 0; color: #fff; background: #0b0c18b8; width: 3.6em; height: 3.6em; font-size: 1em; box-shadow: 0 0 0 6px #ffd34d22, 0 8px 30px #000a; transition: transform .15s; z-index: 2; }
.v-big svg { width: 46%; height: 46%; fill: currentColor; margin-left: 8%; }
.v-big:hover { transform: translate(-50%, -50%) scale(1.06); }

/* aviso breve: "+10 s", "Velocidad 1,5×"… */
.v-osd { position: absolute; left: 50%; top: 9%; transform: translate(-50%, -6px); background: #0b0c18dd; border: 1px solid #ffd34d66; color: var(--gold); font-family: var(--pix); font-size: .85em; padding: .25em .8em; border-radius: 99px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 3; }
.v-osd.on { opacity: 1; transform: translate(-50%, 0); }

/* barra inferior sobre el video */
.v-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6em .7em .35em; background: linear-gradient(to top, #05040ff2 0%, #05040fb0 55%, transparent 100%); transition: opacity .25s ease, transform .25s ease; z-index: 4; }
.modal.video.idle .v-bar { opacity: 0; transform: translateY(8px); pointer-events: none; }
.modal.video.quiz .v-bar { background: linear-gradient(to top, #05040ff2, #05040fcc); padding-top: .5em; }

.v-prog { position: relative; height: 1.25em; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.v-track { position: relative; flex: 1; height: 4px; border-radius: 4px; background: #ffffff2e; transition: height .15s; }
.v-prog:hover .v-track, .modal.video.scrub .v-track, .v-prog:focus-visible .v-track { height: 7px; }
.v-prog:focus-visible { box-shadow: 0 0 0 2px var(--accent2); border-radius: 6px; }
.v-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffb347, var(--gold)); box-shadow: 0 0 8px #ffd34d88; }
.v-chap i { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #05040f; z-index: 1; }
.v-thumb { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff6d6; border: 2px solid var(--gold); box-shadow: 0 0 10px #ffd34daa; transform: scale(.0); transition: transform .15s; z-index: 2; }
.v-prog:hover .v-thumb, .modal.video.scrub .v-thumb, .modal.video.paused .v-thumb, .v-prog:focus-visible .v-thumb { transform: scale(1); }
.v-tip { position: absolute; bottom: 140%; transform: translateX(-50%); background: #0b0c18; border: 1px solid var(--gold); color: var(--gold); font-family: var(--pix); font-size: .72em; padding: .1em .45em; border-radius: 6px; pointer-events: none; white-space: nowrap; }

.v-bar .v-ctrl { display: flex; align-items: center; gap: .15em; margin-top: .15em; font-family: var(--pix); flex-wrap: nowrap; min-width: 0; }
.v-bar .v-ctrl > button, .v-mute { background: none; border: 0; border-radius: 8px; padding: 0; width: 2.1em; height: 2.1em; min-width: 0; display: inline-flex; align-items: center; justify-content: center; color: #f4f0ff; flex: none; transition: background .12s, color .12s; }
.v-bar .v-ctrl > button:hover, .v-mute:hover { background: #ffffff1a; color: var(--gold); }
.v-bar .v-ctrl > button:focus-visible, .v-mute:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }
.v-bar svg { width: 1.3em; height: 1.3em; fill: currentColor; }
.v-bar svg text { font: 700 6.6px/1 Consolas, monospace; fill: currentColor; }
.v-bar .v-ctrl > .v-play svg { width: 1.45em; height: 1.45em; }
.v-vol { display: inline-flex; align-items: center; flex: none; }
.v-volr { -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; border-radius: 4px; margin: 0; background: linear-gradient(90deg, var(--gold) var(--f, 100%), #ffffff33 var(--f, 100%)); transition: width .2s, opacity .2s, margin .2s; cursor: pointer; }
.v-vol:hover .v-volr, .v-volr:focus-visible, .v-vol:focus-within .v-volr { width: 4.6em; opacity: 1; margin: 0 .5em 0 .2em; }
.v-volr::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff6d6; border: 2px solid var(--gold); }
.v-volr::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff6d6; border: 2px solid var(--gold); }
.modal.video.novol .v-volr { display: none; }
.v-time { font-size: .74em; color: #e9e4ff; white-space: nowrap; margin-left: .4em; font-variant-numeric: tabular-nums; }
.v-time .v-sep, .v-time .v-dur { color: #a9aed6; }
.v-grow { flex: 1; min-width: .3em; }
.v-bar .v-rate { font-size: .72em; color: #c9c4e8; gap: .3em; }
.v-bar .v-rate select { background: #ffffff14; border: 1px solid #ffffff33; border-radius: 99px; padding: .1em .5em; color: #fff; cursor: pointer; }
.v-bar .v-rate select:focus-visible { outline: 2px solid var(--accent2); }
.v-bar .v-ctrl > .v-board2 { width: auto; padding: 0 .75em; height: 1.75em; font-size: .78em; border: 1px solid #ffd34d99; background: #ffd34d1f; color: #ffe9a8; margin-left: .2em; }
.v-bar .v-ctrl > .v-board2:hover { background: #ffd34d38; color: #fff; }

.v-foot { display: flex; align-items: center; gap: .6em; min-height: 1.6em; }
.v-foot .v-voice { flex: 1; }
.v-foot .v-end { display: flex; gap: .5em; justify-content: flex-end; }

/* quiz: deja libre la franja de controles */
.v-box .v-quiz { inset: 4% 7% calc(4.4em + 2%) 7%; z-index: 3; }

/* pantalla completa real (elemento) y la de respaldo para iPhone */
.v-stage:fullscreen { background: #000; font-size: clamp(14px, 1.2vw + .9vh, 30px); }
.v-stage:-webkit-full-screen { background: #000; font-size: clamp(14px, 1.2vw + .9vh, 30px); }
.v-stage:fullscreen .v-box { border-radius: 0; box-shadow: none; }
.modal.video.pfs { position: fixed; inset: 0; z-index: 1000; border: 0; border-radius: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: #000; font-size: clamp(13px, 1.1vw + 1vh, 26px); }
.modal.video.pfs .v-head, .modal.video.pfs .v-note, .modal.video.pfs .v-foot { display: none; }
.modal.video.pfs .v-box { border-radius: 0; }
body.v-pfs #rotate { display: none !important; }

/* teléfono (horizontal): el video ocupa todo el escenario y los toques son cómodos */
@media (max-height: 520px), (max-width: 900px) {
  .modal.video { left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; border-width: 0; padding: .25em .4em calc(.25em + env(safe-area-inset-bottom)); gap: .2em; }
  .modal.video .v-note { display: none; }
  .v-head { font-size: .85em; }
  .v-bar { padding: 1.2em .4em .2em; }
  .v-bar .v-rate > span { display: none; }
  .v-foot { min-height: 0; font-size: .85em; }
  .v-foot .v-voice { display: none; }
}
@media (pointer: coarse) {
  .v-bar .v-ctrl > button, .v-mute { width: max(2.1em, 36px); height: max(2.1em, 34px); }
  .v-prog { height: max(1.25em, 22px); }
  .v-thumb { transform: scale(1); }
  .v-volr { display: none; }
  .modal.video:not(.idle) .v-box .v-sub { bottom: calc(64px + 2%); }
  .v-box .v-quiz { bottom: calc(68px + 2%); }
  .v-foot .v-end .btn { min-height: 36px; }
}
@media (max-width: 700px) and (pointer: coarse) {
  .v-bar .v-ctrl > .v-prev, .v-bar .v-ctrl > .v-next { display: none; }
}

/* ---------------- Bienvenida para teléfonos (instalar la app) ----------------
   Vive fuera del escenario 16:9 para usar toda la pantalla, también en vertical. */
#install { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(120% 80% at 50% 0%, #2a1f5c 0%, #120c22 55%, #05040b 100%); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.4;
  opacity: 0; transition: opacity .25s ease; }
#install.in { opacity: 1; }
#install.out { opacity: 0; pointer-events: none; }
#install.menu { background: #05040bf2; }
.ins-card { width: 100%; max-width: 440px; margin: auto; display: flex; flex-direction: column; gap: 14px; transform: translateY(12px); transition: transform .3s ease; }
#install.in .ins-card { transform: none; }
.ins-top { display: flex; align-items: center; gap: 14px; }
.ins-logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 0 2px #ffd34d55, 0 8px 24px #000a; image-rendering: pixelated; flex: none; }
.ins-studio { font-family: var(--pix); font-size: 12px; letter-spacing: .25em; color: var(--muted); }
#install h2 { margin: 2px 0 0; font-family: var(--pix); font-size: 28px; line-height: 1; letter-spacing: .02em; color: #fff; }
#install h2 span { color: var(--gold); text-shadow: 0 0 14px #ffd34d66; }
.ins-why { margin: 4px 0 0; font-size: 17px; }
.ins-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ins-perks li { display: flex; align-items: center; gap: 12px; background: #ffffff0d; border: 1px solid #ffffff14; border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.ins-perks svg { width: 22px; height: 22px; fill: var(--blue); flex: none; }
.ins-body { display: flex; flex-direction: column; gap: 10px; }
.ins-lead { margin: 0; font-size: 15px; color: #e9e4ff; }
.ins-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border-radius: 14px; border: 0; font-family: var(--pix); font-size: 20px; letter-spacing: .04em; color: #1a1206;
  background: linear-gradient(180deg, #ffe27a, #ffc93d); box-shadow: 0 4px 0 #b8861a, 0 10px 30px #ffd34d44; cursor: pointer; transition: transform .1s; }
.ins-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b8861a; }
.ins-btn svg { width: 24px; height: 24px; fill: currentColor; }
.ins-btn:disabled { opacity: .6; }
.ins-main { animation: insPulse 2.2s ease-in-out infinite; }
@keyframes insPulse { 50% { box-shadow: 0 4px 0 #b8861a, 0 10px 40px #ffd34d88; } }
.ins-copy { min-height: 48px; font-size: 16px; }
.ins-small { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.ins-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.ins-steps li { display: flex; align-items: center; gap: 12px; background: #ffd34d12; border: 1px solid #ffd34d40; border-radius: 12px; padding: 10px 12px; font-size: 15px; counter-increment: s; }
.ins-n::before { content: counter(s); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #1a1206; font-family: var(--pix); font-size: 16px; }
.ins-n { flex: none; }
.ins-ic { display: inline-flex; vertical-align: middle; width: 24px; height: 24px; padding: 2px; border-radius: 6px; background: #ffffff1a; }
.ins-ic svg { width: 100%; height: 100%; fill: #7ad7ff; }
.ins-ok { display: flex; gap: 12px; align-items: center; background: #4fd18b1a; border: 1px solid #4fd18b77; border-radius: 12px; padding: 12px; }
.ins-ok svg { width: 36px; height: 36px; fill: var(--ok); flex: none; }
.ins-ok p { margin: 0; }
.ins-skip { min-height: 48px; border-radius: 14px; background: transparent; border: 2px solid #ffffff33; color: #e9e4ff; font-family: var(--pix); font-size: 16px; cursor: pointer; }
.ins-skip:active { background: #ffffff12; }
.ins-foot { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
/* iPhone: flecha animada hacia el botón Compartir de Safari (barra inferior) */
.ins-arrow { position: fixed; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--gold); font-family: var(--pix); font-size: 13px; animation: insBounce 1.2s ease-in-out infinite; pointer-events: none; }
.ins-arrow svg { width: 30px; height: 30px; fill: var(--gold); filter: drop-shadow(0 0 8px #ffd34d88); }
.ins-arrow::after { content: ""; width: 0; height: 0; border: 10px solid transparent; border-top-color: var(--gold); margin-top: 2px; }
@keyframes insBounce { 50% { transform: translate(-50%, 6px); } }
#install.ios .ins-card { padding-bottom: 74px; }
@media (orientation: landscape) and (max-height: 520px) {
  .ins-card { max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; align-items: start; }
  .ins-top, .ins-why, .ins-perks { grid-column: 1; }
  .ins-body, .ins-skip, .ins-foot { grid-column: 2; }
  .ins-body { grid-row: 1 / span 3; }
  .ins-perks li { padding: 7px 10px; font-size: 14px; }
  #install h2 { font-size: 24px; }
  .ins-logo { width: 52px; height: 52px; }
  .ins-arrow { display: none; }
  #install.ios .ins-card { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .ins-main, .ins-arrow { animation: none; } }

/* aviso de girar el teléfono: con un teléfono que rota */
#rotate > div { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 300px; line-height: 1.4; }
.rot-phone { width: 46px; height: 78px; border: 4px solid var(--gold); border-radius: 10px; position: relative; animation: rotPhone 2.4s ease-in-out infinite; box-shadow: 0 0 20px #ffd34d44; }
.rot-phone::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 10px; height: 3px; margin-left: -5px; border-radius: 2px; background: var(--gold); }
@keyframes rotPhone { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* aviso de versión nueva (service worker) */
#sw-update { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 10px; background: #0b0c18f2; border: 2px solid var(--gold); border-radius: 14px; padding: 8px 10px 8px 14px; font: 15px var(--body); color: #fff; box-shadow: 0 10px 30px #000a; max-width: calc(100vw - 24px); }
#sw-update button { font-family: var(--pix); background: var(--gold); color: #1a1206; border: 0; border-radius: 10px; padding: 8px 14px; min-height: 40px; }
#sw-update button.x { background: transparent; color: #fff; padding: 8px; }

/* ---------------- Evento: Erika en directo (simulado) ---------------- */
.live-pill { display: inline-flex; align-items: center; gap: .35em; background: #ff2d55; color: #fff; font-family: var(--pix); font-size: .72em; letter-spacing: .08em; padding: .1em .55em; border-radius: 6px; box-shadow: 0 0 12px #ff2d5588; }
.live-pill i { width: .5em; height: .5em; border-radius: 50%; background: #fff; animation: livePulse 1s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .25; } }
.live-notif { position: absolute; left: 50%; top: 17%; z-index: 45; display: flex; align-items: center; gap: .6em; width: min(70%, 34em); padding: .5em .6em .5em .5em; background: linear-gradient(90deg, #1d0b1fee, #0b0c18ee); border: 2px solid #ff2d55; border-radius: 14px; box-shadow: 0 0 0 4px #ff2d5522, 0 12px 40px #000c, 0 0 30px #ff2d5555; font-family: var(--pix); transform: translate(-50%, -30px) scale(.9); opacity: 0; transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .25s; }
.live-notif.in { transform: translate(-50%, 0) scale(1); opacity: 1; animation: liveShake .5s .35s 2; }
.live-notif.out { transform: translate(-50%, -20px) scale(.95); opacity: 0; }
@keyframes liveShake { 25% { margin-left: -4px; } 75% { margin-left: 4px; } }
.ln-ava { flex: none; width: 3.2em; height: 3.2em; border-radius: 50%; overflow: hidden; border: 2px solid #ff2d55; background: #2a1d3a; display: flex; align-items: center; justify-content: center; }
.ln-ava canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.ln-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1em; }
.ln-top { display: flex; align-items: center; gap: .5em; }
.ln-alert { color: var(--gold); font-size: .8em; letter-spacing: .1em; }
.ln-txt b { font-size: .92em; line-height: 1.15; color: #fff; }
.ln-txt small { font-family: var(--body); font-size: .62em; color: #ffb3c4; }
.ln-go { flex: none; background: #ff2d55; color: #fff; border: 0; border-radius: 10px; padding: .45em .9em; min-height: 2.2em; font-family: var(--pix); box-shadow: 0 3px 0 #a1112f; }
.ln-x { flex: none; background: none; border: 0; color: #fff9; padding: .3em; font-size: .9em; }
body.modal-open .live-notif { display: none; }

.modal.live-modal { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5em; padding: .6em; background: radial-gradient(80% 90% at 50% 40%, #3a0f2bee, #07050ff6); }
.lv-banner { font-size: .72em; color: #ffd6df; text-align: center; max-width: 90%; }
.lv-sim { display: inline-block; background: #ffd34d; color: #1a1206; font-family: var(--pix); padding: 0 .5em; border-radius: 5px; margin-right: .4em; }
.lv-phone { position: relative; flex: 1 1 0; min-height: 0; aspect-ratio: 9 / 16; max-width: 92%; border-radius: 1.2em; overflow: hidden; border: .35em solid #1b1530; box-shadow: 0 0 0 2px #ff2d5566, 0 20px 60px #000; background: #000; }
.lv-phone canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.lv-head { position: absolute; left: .5em; right: .5em; top: .5em; display: flex; align-items: center; gap: .4em; font-size: .62em; color: #fff; text-shadow: 0 1px 2px #000; }
.lv-head small { display: block; color: #ffffffaa; font-size: .85em; }
.lv-head > div:nth-child(2) { flex: 1; min-width: 0; line-height: 1.1; }
.lv-ava { width: 2.4em; height: 2.4em; border-radius: 50%; overflow: hidden; border: 2px solid #ff2d55; flex: none; }
.lv-ava canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.lv-views { background: #0007; border-radius: 6px; padding: .05em .4em; font-family: var(--pix); }
.lv-say { position: absolute; left: 8%; right: 8%; top: 13%; background: #fff; color: #1a1206; border-radius: .8em; padding: .35em .6em; font-size: .62em; line-height: 1.25; text-align: center; box-shadow: 0 4px 0 #0005; }
.lv-say:empty { display: none; }
.lv-say.pop, .lv-gift.pop { animation: pop .3s ease both; }
.lv-chat { position: absolute; left: .5em; right: 22%; bottom: .6em; display: flex; flex-direction: column; gap: .25em; font-size: .56em; }
.lv-msg { background: #0009; color: #fff; border-radius: .6em; padding: .2em .5em; line-height: 1.25; animation: pop .25s ease both; }
.lv-msg b { color: #9fe3ff; }
.lv-msg.mau b { color: var(--gold); }
.lv-msg.foe b { color: #ff9fb0; }
.lv-gift { position: absolute; left: 6%; top: 23.5%; background: linear-gradient(90deg, #ff2d55, #ff8a3d); color: #fff; border-radius: 99px; padding: .25em .8em; font-size: .62em; font-family: var(--pix); box-shadow: 0 6px 18px #0008; }
.lv-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; background: #07050fd9; color: #fff; text-align: center; padding: 1em; font-family: var(--pix); }
.lv-end span { font-family: var(--body); font-size: .75em; color: #ffd6df; }
.lv-back { flex: none; }
@media (max-height: 520px), (max-width: 900px) {
  .live-notif { width: 80%; top: 22%; }
  .lv-banner { font-size: .62em; }
}
@media (prefers-reduced-motion: reduce) { .live-pill i { animation: none; } .live-notif.in { animation: none; } }
