/* Celulares (equipos) - mobile first */
body.phone { overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
body.phone.t1 { --a: var(--t1-a); --b: var(--t1-b); --a-rgb: var(--t1-a-rgb); --b-rgb: var(--t1-b-rgb); }
body.phone.t2 { --a: var(--t2-a); --b: var(--t2-b); --a-rgb: var(--t2-a-rgb); --b-rgb: var(--t2-b-rgb); }
body.phone.t1 .mb-bg .aur.a2, body.phone.t2 .mb-bg .aur.a1 { opacity: .12; }
body.phone.t1 .mb-bg .aur.a1 { background: radial-gradient(circle, rgba(var(--t1-a-rgb), .9), transparent 62%); }
body.phone.t2 .mb-bg .aur.a2 { background: radial-gradient(circle, rgba(var(--t2-a-rgb), .9), transparent 62%); }

.view { position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom)); }

.brand { text-align: center; line-height: .95; }
.brand .l1 { font-family: var(--f-display); font-size: clamp(34px, 11vw, 56px); letter-spacing: .04em; background: linear-gradient(180deg, #fff 20%, #b9c3ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(130, 150, 255, .5)); }
.brand .l1 em { font-style: normal; background: linear-gradient(180deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 180, 40, .55)); }
.brand .l2 { font-size: 12px; letter-spacing: .5em; text-transform: uppercase; color: var(--txt-2); margin-top: 6px; padding-left: .5em; }

/* ----- selección de equipo ----- */
#vSelect { justify-content: center; gap: 22px; }
#vSelect h2 { margin: 0; text-align: center; font-family: var(--f-display); font-weight: 400; letter-spacing: .06em; font-size: 22px; color: var(--txt-2); }
.pick { display: grid; gap: 14px; }
.pick button {
    font-family: var(--f-display); position: relative; overflow: hidden; border: 0; border-radius: 26px; padding: 26px 20px; color: #fff; cursor: pointer;
    font-family: var(--f-display); font-size: clamp(38px, 12vw, 58px); letter-spacing: .05em;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .18);
    transition: transform .15s;
}
.pick button:active { transform: scale(.97); }
.pick button small { display: block; font-family: var(--f-body); font-size: 12px; letter-spacing: .3em; opacity: .85; font-weight: 600; margin-bottom: 2px; }
.pick button::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.5s ease-in-out infinite; }
.pick .p1 { background: linear-gradient(135deg, var(--t1-a), var(--t1-b)); }
.pick .p2 { background: linear-gradient(135deg, var(--t2-a), var(--t2-b)); animation-delay: 1s; }
.pick .p2::after { animation-delay: 1.4s; }
.codebox { display: flex; gap: 10px; }
.codebox input { flex: 1; text-align: center; letter-spacing: .3em; font-weight: 800; font-size: 20px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff; padding: 12px; outline: none; text-transform: uppercase; }
.codebox input:focus { border-color: var(--gold); }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ----- juego ----- */
#vGame { gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.teamtag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-weight: 800; letter-spacing: .14em; font-size: 13px; text-transform: uppercase; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 22px rgba(var(--a-rgb), .6); }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn.off i { background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: blink .8s infinite; }
.conn.off { color: var(--warn); }
@keyframes blink { 50% { opacity: .25; } }

.scorebar { display: flex; align-items: stretch; justify-content: center; gap: 12px; margin-top: 4px; }
.scorebar .sc { flex: 1; text-align: center; border-radius: 18px; padding: 8px 6px 6px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.scorebar .sc b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 38px; line-height: 1; }
.scorebar .sc span { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--txt-2); }
.scorebar .sc.me { border-color: rgba(var(--a-rgb), .8); box-shadow: 0 0 20px rgba(var(--a-rgb), .35); }
.scorebar .vs { align-self: center; font-family: var(--f-display); color: var(--txt-2); font-size: 18px; }
.bump { animation: bump .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); color: var(--gold); } 100% { transform: scale(1); } }

.buzz-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.buzz {
    --bc: var(--a); --bc2: var(--b); --bc-rgb: var(--a-rgb);
    position: relative; width: min(84vw, 62vh, 440px); aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer; outline: none;
    background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .55), transparent 38%), linear-gradient(160deg, var(--bc), var(--bc2));
    box-shadow: 0 0 0 10px rgba(var(--bc-rgb), .18), 0 0 70px rgba(var(--bc-rgb), .65), 0 26px 40px rgba(0, 0, 0, .5), inset 0 -16px 30px rgba(0, 0, 0, .28), inset 0 6px 0 rgba(255, 255, 255, .45);
    color: #fff; font-family: var(--f-body); display: flex; align-items: center; justify-content: center; text-align: center;
    transition: transform .12s ease-out, filter .3s, box-shadow .3s;
    animation: breathe 3.2s ease-in-out infinite;
}
.buzz .ring { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid rgba(var(--bc-rgb), .8); opacity: 0; pointer-events: none; }
.buzz .core { position: relative; z-index: 2; padding: 0 12%; display: flex; flex-direction: column; gap: 8px; align-items: center; text-shadow: 0 3px 14px rgba(0, 0, 0, .45); }
.buzz .core strong { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 10.5vw, 62px); line-height: 1; letter-spacing: .03em; text-transform: uppercase; }
.buzz .core small { font-size: clamp(12px, 3.6vw, 17px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.buzz.pop .core { animation: pop .5s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-14px); } 40% { transform: translateX(12px); } 60% { transform: translateX(-9px); } 80% { transform: translateX(6px); } }
@keyframes flicker { 0%, 100% { filter: brightness(1); } 45% { filter: brightness(1.35); } 55% { filter: brightness(.85); } }
@keyframes jump { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.1); } 60% { transform: scale(.97); } }
@keyframes spinbg { to { transform: rotate(360deg); } }

/* estados del botón */
.buzz[data-ui="espera"] { --bc: #3a4380; --bc2: #1c2257; --bc-rgb: 80, 100, 220; filter: saturate(.7) brightness(.85); animation: breathe 5s ease-in-out infinite; }
.buzz[data-ui="espera"] .ring { animation: ripple 3.6s ease-out infinite; opacity: 0; border-color: rgba(var(--a-rgb), .6); }
.buzz[data-ui="preparate"] { --bc: #ffcf3a; --bc2: #ff8a1f; --bc-rgb: 255, 170, 40; animation: flicker .5s infinite; }
.buzz[data-ui="preparate"] .ring { animation: ripple 1s ease-out infinite; }
.buzz[data-ui="presiona"] { --bc: var(--a); --bc2: var(--b); --bc-rgb: var(--a-rgb); animation: breathe .7s ease-in-out infinite; filter: brightness(1.15) saturate(1.2); }
.buzz[data-ui="presiona"] .ring { animation: ripple 1.1s ease-out infinite; }
.buzz[data-ui="presiona"] .ring.r2 { animation-delay: .55s; }
.buzz[data-ui="presiona"]:active, .buzz.pressed { transform: scale(.93); }
.buzz[data-ui="primero"], .buzz[data-ui="correcta"], .buzz[data-ui="final_gana"] { --bc: #2cf5a0; --bc2: #05a867; --bc-rgb: 25, 230, 140; animation: jump 1s ease-in-out infinite; }
.buzz[data-ui="primero"] .ring, .buzz[data-ui="correcta"] .ring { animation: ripple 1.2s ease-out infinite; }
.buzz[data-ui="final_gana"] { --bc: #ffd34a; --bc2: #ff8a1f; --bc-rgb: 255, 190, 50; }
.buzz[data-ui="oportunidad"] { --bc: #ffd34a; --bc2: #ff7a00; --bc-rgb: 255, 170, 30; animation: jump .8s ease-in-out infinite; }
.buzz[data-ui="oportunidad"] .ring { animation: ripple 1s ease-out infinite; }
.buzz[data-ui="otro_primero"], .buzz[data-ui="otro_acerto"], .buzz[data-ui="final_pierde"] { --bc: #5a4062; --bc2: #2a1b34; --bc-rgb: 130, 70, 110; filter: saturate(.7); animation: none; }
.buzz[data-ui="perdida"], .buzz[data-ui="sinpuntos"] { --bc: #ff4d6d; --bc2: #a1102b; --bc-rgb: 255, 59, 92; animation: shake .6s 1; }
.buzz[data-ui="sinpuntos"] { --bc: #6b6f8f; --bc2: #34385c; --bc-rgb: 120, 125, 170; }
.buzz[data-ui="tiempo"] { --bc: #ff9a3a; --bc2: #d1370a; --bc-rgb: 255, 120, 30; animation: shake .6s 1; }
.buzz[data-ui="anulada"], .buzz[data-ui="pausa"] { --bc: #7a7fa8; --bc2: #3b3f66; --bc-rgb: 130, 135, 190; animation: breathe 3s infinite; }
.buzz[data-ui="pausa"] .core strong { animation: blink 1.4s infinite; }
.buzz[data-ui="final_empate"] { --bc: #ffd34a; --bc2: #8a5cff; --bc-rgb: 190, 150, 255; animation: jump 1.2s infinite; }
.buzz:not([data-ui="presiona"]) { cursor: default; }

.foot { text-align: center; font-size: 12px; color: var(--txt-2); letter-spacing: .08em; min-height: 18px; }
.foot a { color: var(--txt-2); text-decoration: underline; }
.team-flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(var(--bc-flash, 255, 255, 255), .55), transparent 70%); }
.team-flash.go { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
body.no-anim .buzz, body.no-anim .buzz .ring { animation: none !important; }
@media (max-height: 640px) { .scorebar .sc b { font-size: 28px; } .brand .l2 { display: none; } }

/* ----- responder con opciones (A-D) ----- */
body.answering .scorebar, body.answering .buzz-wrap, body.answering .foot, body.answering .brand { display: none; }
.answer { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; animation: ansin .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes ansin { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.ans-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ans-tag { font-family: var(--f-display); letter-spacing: .05em; font-size: 22px; padding: 6px 16px; border-radius: 999px; background: linear-gradient(135deg, #2cf5a0, #05a867); box-shadow: 0 0 22px rgba(25, 230, 140, .6); }
.ans-tag.opp { background: linear-gradient(135deg, #ffd34a, #ff7a00); color: #2a1600; box-shadow: 0 0 22px rgba(255, 170, 30, .6); }
.ans-time { font-family: var(--f-display); font-size: 64px; line-height: 1; min-width: 80px; text-align: right; text-shadow: 0 0 24px rgba(var(--a-rgb), .9); }
.ans-time.low { color: #ff5470; animation: blink .5s infinite; }
.ans-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ans-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--a), var(--b)); border-radius: 8px; transition: width .2s linear; }
.ans-q { font-size: clamp(18px, 5.4vw, 26px); font-weight: 800; line-height: 1.22; text-align: center; padding: 10px 6px; text-wrap: balance; }
.ans-opts { flex: 1; display: grid; grid-template-columns: 1fr; gap: 10px; align-content: start; overflow: auto; padding-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 14px 16px; min-height: 68px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .22); color: #fff; cursor: pointer;
    font-family: var(--f-body); font-weight: 700; font-size: clamp(16px, 4.6vw, 21px); line-height: 1.2;
    background: linear-gradient(135deg, rgba(var(--a-rgb), .38), rgba(14, 18, 60, .85)); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform .12s, background .2s, border-color .2s; }
.opt b { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 400; font-size: 24px; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 14px rgba(var(--a-rgb), .7); }
.opt:active { transform: scale(.97); }
.opt.sel { border-color: var(--gold); background: linear-gradient(135deg, rgba(255, 200, 61, .5), rgba(14, 18, 60, .85)); }
.ans-opts.lock .opt:not(.sel) { opacity: .4; }
.ans-opts.lock .opt { pointer-events: none; }

.buzz[data-ui="detenido"], .buzz[data-ui="nadie"] { --bc: #6b6f8f; --bc2: #34385c; --bc-rgb: 120, 125, 170; animation: breathe 4s infinite; }

.plogo { display: block; margin: 4px auto 0; width: min(48vw, 200px); height: auto; opacity: .9; pointer-events: none; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5)); }
body.answering .plogo { width: 120px; opacity: .6; }
@media (max-height: 640px) { .plogo { width: 110px; } }

/* ----- pantalla de bienvenida (enlace de invitación) ----- */
#vWelcome { justify-content: center; align-items: center; gap: 26px; text-align: center; }
.plogo.big { width: min(70vw, 300px); margin: 0 auto; }
.play-btn { position: relative; width: min(74vw, 330px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; color: #2a1600;
    font-family: var(--f-display); font-size: clamp(54px, 17vw, 84px); letter-spacing: .06em;
    background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .8), transparent 38%), linear-gradient(160deg, #ffe27a, #ff9b1f);
    box-shadow: 0 0 0 10px rgba(255, 190, 60, .2), 0 0 80px rgba(255, 170, 40, .7), 0 26px 40px rgba(0, 0, 0, .5), inset 0 -14px 26px rgba(160, 70, 0, .3);
    animation: breathe 1.8s ease-in-out infinite; }
.play-btn::before, .play-btn::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid rgba(255, 200, 61, .8); animation: ripple 2s ease-out infinite; }
.play-btn::after { animation-delay: 1s; }
.play-btn:active { transform: scale(.94); }
.play-btn span { position: relative; text-shadow: 0 2px 0 rgba(255, 255, 255, .4); }

.buzz[data-ui="etapa"] { --bc: #ffd34a; --bc2: #ff7a00; --bc-rgb: 255, 170, 30; animation: breathe 1.4s infinite; }

/* ===== Rendimiento en celulares (evita calentamiento) ===== */
body.phone .mb-bg .aur { filter: none; animation: none; will-change: auto; }
body.phone .mb-bg .beam, body.phone .mb-bg .grid { display: none; }
body.phone .mb-bg .aur.a3 { display: none; }
body.phone .scorebar .sc, body.phone .conn, body.phone .opt { -webkit-backdrop-filter: none; backdrop-filter: none; }
.buzz { will-change: transform; }
/* Ahorro de energía: sin movimiento cuando nadie toca el celular y no hay nada que hacer */
body.saver *, body.saver *::before, body.saver *::after { animation: none !important; transition: none !important; }
body.saver .play-btn::before, body.saver .play-btn::after, body.saver .buzz .ring { display: none; }

/* Las 4 opciones deben verse SIEMPRE completas sin hacer scroll, incluso en celulares pequeños */
.ans-opts { grid-template-rows: repeat(4, minmax(46px, 1fr)); align-content: stretch; }
.opt { min-height: 0; }
@media (max-height: 720px) {
    body.answering .plogo { display: none; }
    .ans-tag { font-size: 16px; padding: 4px 12px; }
    .ans-time { font-size: 46px; min-width: 60px; }
    .ans-q { font-size: 17px; padding: 2px 4px; line-height: 1.18; }
    .ans-opts { gap: 7px; }
    .opt { padding: 6px 12px; gap: 10px; font-size: 15px; border-radius: 16px; }
    .opt b { width: 34px; height: 34px; font-size: 20px; border-radius: 10px; }
    #vGame { gap: 6px; }
    body.answering .teamtag, body.answering .conn { font-size: 11px; padding: 5px 10px; }
}

/* Celular girado (horizontal): opciones en 2 columnas y cabecera compacta */
@media (orientation: landscape) and (max-height: 520px) {
    .ans-opts { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(44px, 1fr)); }
    .ans-q { font-size: 15px; }
    .ans-time { font-size: 38px; }
    body.answering .teamtag, body.answering .conn, body.answering .brand { display: none; }
    .buzz { width: min(60vh, 70vw); }
    .brand .l2 { display: none; }
    .plogo { display: none; }
    #vSelect { gap: 10px; }
    .pick { grid-template-columns: 1fr 1fr; }
    .pick button { padding: 12px; font-size: 34px; }
    .play-btn { width: min(60vh, 50vw); }
    .scorebar { display: none; }
}
