/* EL GRAN CONCURSO — mando en el móvil */
:root {
  --pink: #ff2bd6; --cyan: #23d5ff; --yellow: #ffd23f; --green: #2eff7a; --red: #ff2a4a; --c: #ff2bd6;
  --font: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  --display: 'Lilita One', 'Arial Black', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font); color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% -10%, #5a1fd1 0%, #2a0d73 35%, #12062b 75%) fixed, #12062b;
}
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.hidden { display: none !important; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 14px; animation: scrIn .3s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: scale(.97); } }
h2 { font-family: var(--display); font-size: 30px; text-align: center; letter-spacing: .5px; color: var(--yellow); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
p { text-align: center; font-size: 19px; font-weight: 700; opacity: .9; }
p.small { font-size: 15px; opacity: .7; }

/* cabecera */
header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(10, 2, 30, .55); border-bottom: 3px solid var(--c); }
header .av { width: 44px; height: 44px; border-radius: 50%; background: var(--c); border: 3px solid #fff; display: grid; place-items: center; font-size: 26px; flex: none; }
header .nm { flex: 1; font-weight: 800; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .sc { font-family: var(--display); font-size: 26px; color: var(--yellow); }
header .sc small { font-family: var(--font); font-size: 13px; margin-left: 3px; opacity: .8; color: #fff; }
#lost { position: fixed; top: 0; left: 0; right: 0; z-index: 9; background: #b3002d; text-align: center; padding: 6px; font-weight: 800; }

/* entrar */
.logo { text-align: center; font-family: var(--display); line-height: .95; margin-bottom: 8px; }
.logo span { display: block; text-shadow: -3px -3px 0 #2a0866, 3px -3px 0 #2a0866, -3px 3px 0 #2a0866, 3px 3px 0 #2a0866, 0 6px 0 #c2410c, 0 10px 0 #2a0866; }
.logo .l1 { font-size: 30px; color: #fff; transform: rotate(-4deg); }
.logo .l2 { font-size: 56px; color: var(--yellow); }
form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 16px; }
input { font: 800 26px var(--font); padding: 12px 16px 8px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .6); background: rgba(10, 2, 30, .6); color: #fff; outline: none; text-align: center; }
input:focus { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 210, 63, .3); }
#inRoom { text-transform: uppercase; letter-spacing: 10px; font-family: var(--display); font-size: 40px; }
.err { min-height: 24px; text-align: center; color: #ffb3c0; font-weight: 800; }

button.big {
  font: 400 28px var(--display); letter-spacing: .5px; color: #2a0866; padding: 16px 20px 12px; border-radius: 999px; border: 4px solid #fff; cursor: pointer; width: 100%; max-width: 380px;
  background: linear-gradient(180deg, #fff27a 0%, #ffd23f 45%, #ff9d1f 100%); box-shadow: 0 7px 0 #b3540b, 0 12px 20px rgba(0, 0, 0, .4);
}
button.big:active { transform: translateY(5px); box-shadow: 0 2px 0 #b3540b; }
button.big:disabled { filter: grayscale(.8) brightness(.7); }
button.big.alt { background: linear-gradient(180deg, #9ff5ff, #23d5ff 50%, #1785ff); box-shadow: 0 7px 0 #0a4c99; }
button.link { background: none; border: 0; color: #fff; opacity: .65; font: 700 16px var(--font); text-decoration: underline; padding: 8px; }

/* pantalla LCD */
.lcd { width: 100%; max-width: 420px; border-radius: 24px; padding: 26px 20px; text-align: center; background: linear-gradient(180deg, #1d0b52, #0d0430); border: 4px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 5px rgba(35, 213, 255, .3), inset 0 0 40px rgba(35, 213, 255, .15); }
.lcd .ic { font-size: 64px; line-height: 1.1; animation: bob 1.8s ease-in-out infinite; }
.lcd .t { font-family: var(--display); font-size: 22px; color: var(--cyan); letter-spacing: 1px; margin-top: 6px; }
.lcd .m { font-size: 26px; font-weight: 800; line-height: 1.15; margin-top: 6px; }
.lcd .s { font-size: 17px; opacity: .8; margin-top: 8px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.mini-handset { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: .25; margin-top: 10px; }
.mini-handset i { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a9a, #e8102a 50%, #7a0010); margin-bottom: 4px; }
.mini-handset b { width: 90px; height: 12px; border-radius: 6px; }
.mini-handset b:nth-of-type(1) { background: #00b7ff; } .mini-handset b:nth-of-type(2) { background: #ff3fa4; } .mini-handset b:nth-of-type(3) { background: #8fd61f; } .mini-handset b:nth-of-type(4) { background: #ffae00; }

/* personajes */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; overflow-y: auto; padding: 4px; }
.ch { border: 3px solid rgba(255, 255, 255, .7); border-radius: 18px; background: rgba(255, 255, 255, .08); padding: 10px 4px 6px; display: flex; flex-direction: column; align-items: center; color: #fff; font: 800 15px var(--font); }
.ch .e { font-size: 42px; line-height: 1.1; }
.ch:active { transform: scale(.94); }
.ch.taken { opacity: .3; filter: grayscale(1); pointer-events: none; }
.ch.taken::after { content: 'Ocupado'; font-size: 12px; }
.ch.mine { border-color: var(--yellow); background: rgba(255, 210, 63, .25); }

.me-big { width: 150px; height: 150px; border-radius: 50%; background: var(--c); border: 6px solid #fff; display: grid; place-items: center; font-size: 90px; box-shadow: 0 0 40px var(--c); animation: bob 2s ease-in-out infinite; }

/* pulsador gigante */
#sBuzz { justify-content: space-evenly; }
.bsub { font-size: 20px; font-weight: 800; text-align: center; min-height: 28px; }
.dome {
  width: min(78vw, 56vh); height: min(78vw, 56vh); border-radius: 50%; border: 10px solid #1b1b24; cursor: pointer;
  background: radial-gradient(circle at 34% 28%, #ffd0d6 0%, #ff5a6e 14%, #e8102a 45%, #9b0018 80%, #5a000c 100%);
  box-shadow: 0 0 0 10px #2c2c38, 0 18px 0 10px #111118, 0 30px 40px rgba(0, 0, 0, .6), inset 0 -18px 30px rgba(0, 0, 0, .35);
  display: grid; place-items: center; transition: transform .06s; animation: domeGlow 1.2s ease-in-out infinite alternate;
}
.dome span { font: 400 clamp(32px, 11vw, 56px) var(--display); color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.dome:active, .dome.pressed { transform: translateY(12px) scale(.97); box-shadow: 0 0 0 10px #2c2c38, 0 6px 0 10px #111118, 0 10px 20px rgba(0, 0, 0, .6), inset 0 -10px 20px rgba(0, 0, 0, .35), 0 0 60px #ff2a4a; }
.dome.pressed { animation: none; filter: brightness(1.3); }
@keyframes domeGlow { to { box-shadow: 0 0 0 10px #2c2c38, 0 18px 0 10px #111118, 0 30px 40px rgba(0, 0, 0, .6), inset 0 -18px 30px rgba(0, 0, 0, .35), 0 0 50px rgba(255, 42, 74, .7); } }

/* respuestas */
.tbar { width: 100%; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; flex: none; }
.tbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); transform-origin: left; }
.tbar.run i { animation: tbar var(--t, 15s) linear forwards; }
@keyframes tbar { to { transform: scaleX(0); } }
#sAns { justify-content: flex-start; }
.q { font-size: 18px; font-weight: 700; text-align: center; line-height: 1.2; opacity: .9; max-height: 4.8em; overflow: hidden; }
.answers { flex: 1; width: 100%; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ab {
  flex: 1; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; border-radius: 22px; border: 4px solid #fff; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 45%), var(--k); color: #fff;
  box-shadow: 0 7px 0 rgba(0, 0, 0, .35); font: 800 clamp(18px, 5.2vw, 26px) var(--font); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); transition: transform .06s, opacity .2s, filter .2s;
}
.ab .k { flex: none; width: 54px; height: 54px; border-radius: 16px; background: rgba(0, 0, 0, .25); display: grid; place-items: center; font: 400 34px var(--display); }
.ab:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.ab.dis { opacity: .2; filter: grayscale(1); pointer-events: none; }
.answers.locked .ab { pointer-events: none; opacity: .35; filter: grayscale(.6); }
.answers.locked .ab.chosen { opacity: 1; filter: none; transform: scale(1.03); box-shadow: 0 0 0 5px var(--yellow), 0 0 30px var(--yellow); }

/* elegir */
#sPick { justify-content: flex-start; }
.picks { width: 100%; flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.pk { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 20px; border: 4px solid #fff; color: #fff; font: 800 24px var(--font); background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 50%), var(--k); box-shadow: 0 6px 0 rgba(0, 0, 0, .35); text-align: left; min-height: 72px; }
.pk .i { font-size: 38px; width: 50px; text-align: center; }
.pk .l { flex: 1; }
.pk small { display: block; font-size: 16px; opacity: .85; }
.pk:active { transform: translateY(4px); }
.picks.locked .pk { opacity: .35; pointer-events: none; }
.picks.locked .pk.chosen { opacity: 1; box-shadow: 0 0 0 5px var(--yellow); }

/* resultado */
#sRes.ok { background: radial-gradient(circle, rgba(46, 255, 122, .35), transparent 70%); }
#sRes.ko { background: radial-gradient(circle, rgba(255, 42, 74, .4), transparent 70%); }
.res-ic { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-size: 86px; border: 6px solid #fff; animation: pop .45s cubic-bezier(.2, 1.8, .4, 1); }
#sRes.ok .res-ic { background: #12b85a; box-shadow: 0 0 50px var(--green); }
#sRes.ko .res-ic { background: #c4122f; box-shadow: 0 0 50px var(--red); }
#sRes.nu .res-ic { background: #3a2a7a; }
.res-msg { font: 400 34px var(--display); text-align: center; }
.res-pts { font: 400 52px var(--display); color: var(--yellow); text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.res-sub { font-size: 18px; font-weight: 700; opacity: .85; text-align: center; }
@keyframes pop { from { transform: scale(0); } }
.trophy { font-size: 110px; animation: pop .5s cubic-bezier(.2, 1.8, .4, 1), bob 2s ease-in-out .5s infinite; }
