/* UPSS SPACE — estilos */
:root {
  --bg: #0a0c13;
  --panel: rgba(18, 21, 31, 0.95);
  --panel2: #1d2233;
  --line: #06070b;
  --txt: #f3f5f9;
  --muted: #a4adc2;
  --pri: #ff3b4e;
  --pri2: #ff7b4d;
  --ok: #3ddc84;
  --gold: #ffd331;
  --cyan: #45e3ff;
  --red: #ff3b4e;
  --disp: 'Barlow Condensed', 'Roboto Condensed', 'sans-serif-condensed', 'Avenir Next Condensed', 'Arial Narrow', 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font: 'Fredoka', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input, textarea, select { -webkit-user-select: text; user-select: text; font-family: var(--font); }
button { font-family: var(--font); cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.red { color: var(--red); }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; display: block; background: #070818; }

/* ---------- Botones ---------- */
.btn {
  position: relative; border: 3px solid var(--line); border-radius: 8px; padding: 11px 16px;
  font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(#454e67, #2c3346);
  box-shadow: 0 4px 0 var(--line), inset 0 2px 0 rgba(255,255,255,.25); transition: transform .08s, filter .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line), inset 0 2px 0 rgba(255,255,255,.2); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(#ff4a59, #cf1f36); }
.btn.danger { background: linear-gradient(#ff4d5e, #b81a2b); }
.btn.wa { background: linear-gradient(#35d46b, #1ea952); }
.btn.bots { background: linear-gradient(to top, #2fc4dc 4px, rgba(0,0,0,0) 4px), linear-gradient(#343c51, #222837); }
.btn.ghost { background: rgba(255,255,255,.08); box-shadow: 0 3px 0 var(--line); }
.btn.big { font-size: 24px; line-height: 1.15; padding: 12px 20px; border-radius: 10px; font-weight: 700; letter-spacing: .3px; }
.btn.small { font-size: 14px; padding: 7px 11px; border-radius: 6px; }
.btn small { display: block; font-size: 12px; font-weight: 500; opacity: .85; margin-top: 2px; white-space: normal; }
.btn.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.inp {
  border: 3px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 17px; font-weight: 600;
  background: #f3f5f9; color: #151926; outline: none; width: 100%; min-width: 0;
}
.inp:focus { box-shadow: 0 0 0 3px rgba(69,227,255,.6); }
select.inp { padding: 7px 10px; font-size: 15px; }
.card { background: var(--panel); border: 3px solid var(--line); border-radius: 10px; box-shadow: 0 6px 0 var(--line); }
.x { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 6px; border: 3px solid var(--line); background: #ff4d5e; color: #fff; font-size: 18px; font-weight: 700; z-index: 3; }

/* ---------- Inicio ---------- */
#home { position: absolute; inset: 0; z-index: 20; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.home-bg { position: fixed; inset: 0; background: #0a0c13 url('../img/bg.jpg') center/cover no-repeat; }
.home-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(6,8,14,.5), rgba(6,8,14,.9)); }
.home-wrap { position: relative; max-width: 440px; min-height: 100%; margin: 0 auto; padding: calc(10px + var(--safe-t)) 14px calc(16px + var(--safe-b)); display: flex; flex-direction: column; justify-content: center; gap: 12px; align-items: stretch; }
.logo { width: auto; max-width: min(340px, 82%); max-height: 21vh; height: auto; margin: 0 auto -4px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); animation: float 3.5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
.profile { display: flex; gap: 12px; padding: 10px 12px; align-items: center; }
.av-btn { position: relative; flex: 0 0 84px; width: 84px; height: 84px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.av-btn:hover #homeAvatar, .av-btn:focus-visible #homeAvatar { background: radial-gradient(circle, rgba(130,160,220,.55), transparent 70%); }
#homeAvatar { display: block; width: 84px; height: 84px; background: radial-gradient(circle, rgba(110,140,200,.35), transparent 70%); border-radius: 50%; }
.av-edit { position: absolute; right: -2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); font-size: 15px; line-height: 26px; text-align: center; }
.prof-right { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prof-right label { font-size: 13px; color: var(--muted); font-weight: 600; }
.prof-row { display: flex; gap: 8px; align-items: center; }
.lvl { flex: 1; font-size: 13px; font-weight: 600; color: var(--gold); }
.xpbar { height: 9px; border-radius: 3px; background: rgba(255,255,255,.12); border: 2px solid var(--line); overflow: hidden; margin-top: 2px; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd331, #ff8a1f); }
.home-actions { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.join-row .inp.code { flex: 1.2; text-align: center; letter-spacing: 6px; text-transform: uppercase; font-size: 20px; }
.invite { padding: 12px 14px; text-align: center; background: linear-gradient(135deg, rgba(255,59,78,.94), rgba(150,24,44,.94)); }
.inv-title { font-size: 18px; font-weight: 700; }
.inv-title b { letter-spacing: 3px; background: rgba(0,0,0,.25); padding: 1px 8px; border-radius: 4px; }
.home-msg { background: rgba(255,59,78,.92); border: 3px solid var(--line); border-radius: 7px; padding: 10px 12px; font-weight: 600; text-align: center; }
.home-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin-top: -2px; }
.lnk { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 6px 7px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.lnk:hover, .lnk:focus-visible { color: #fff; background: rgba(255,255,255,.08); }
.btn.friends { background: linear-gradient(to top, #4f8cff 4px, rgba(0,0,0,0) 4px), linear-gradient(#343c51, #222837); }
/* jugar con amigos */
.friends .fr-or { text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 2px; }
.friends .join-row .inp.code { flex: 1.3; min-width: 0; text-align: center; letter-spacing: 6px; text-transform: uppercase; font-size: 20px; }
.friends .fr-err { color: #ff8a95; font-size: 13.5px; font-weight: 600; text-align: center; margin-top: -4px; }
.friends .fr-more { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; }
.home-msg.ok { background: rgba(61,220,132,.9); }
.stats { text-align: center; font-size: 14px; color: var(--muted); }
.foot { text-align: center; font-size: 12px; color: rgba(255,255,255,.35); }
body.busy #home { cursor: progress; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
#joyZone { position: absolute; inset: 0; z-index: 0; touch-action: none; }
.joy { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: rgba(255,255,255,.1); border: 3px solid rgba(255,255,255,.35); pointer-events: none !important; z-index: 1; }
.joy i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.55); border: 3px solid rgba(0,0,0,.3); transform: translate(-50%,-50%); }
.panel { position: absolute; background: var(--panel); border: 3px solid var(--line); border-radius: 7px; z-index: 2; }
.tasks { left: calc(8px + var(--safe-l)); top: calc(54px + var(--safe-t)); width: min(300px, 46vw); max-height: 42vh; overflow: auto; padding: 8px 10px; font-size: 13px; }
.tasks .ph { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--gold); cursor: pointer; }
.tasks .ph::after { content: ' ▾'; opacity: .6; }
.tasks.collapsed .ph::after { content: ' ▸'; }
.tasks.collapsed ul { display: none; }
.tasks ul { list-style: none; margin: 0; padding: 0; }
.tasks li { padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.1); line-height: 1.25; }
.tasks li.done { color: var(--ok); text-decoration: line-through; opacity: .8; }
.tasks li.fake { color: #ffb0b8; }
.prog { position: absolute; left: calc(8px + var(--safe-l)); top: calc(8px + var(--safe-t)); width: min(300px, 46vw); z-index: 2; font-size: 11px; font-weight: 600; color: #d6ffe6; text-shadow: 0 1px 2px #000; }
.prog-bar { height: 16px; background: rgba(0,0,0,.6); border: 3px solid var(--line); border-radius: 5px; overflow: hidden; margin-top: 2px; }
.prog-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2bd673, #8cff5e); transition: width .6s cubic-bezier(.2,1.4,.4,1); }
.prog.glow .prog-bar { animation: pglow .9s ease-out; }
@keyframes pglow { 0% { box-shadow: 0 0 0 0 rgba(140,255,94,.9); } 40% { box-shadow: 0 0 18px 6px rgba(140,255,94,.75); } 100% { box-shadow: 0 0 0 0 rgba(140,255,94,0); } }
.top-right { position: absolute; right: calc(8px + var(--safe-r)); top: calc(8px + var(--safe-t)); display: flex; gap: 6px; z-index: 6; }
.ibtn { position: relative; width: 46px; height: 46px; border-radius: 7px; border: 3px solid var(--line); background: rgba(34,40,56,.92); color: #fff; font-size: 20px; box-shadow: 0 3px 0 var(--line); }
.ibtn:active { transform: translateY(2px); }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); padding: 0 4px; }
.alert-bar { position: absolute; left: 50%; top: calc(62px + var(--safe-t)); transform: translateX(-50%); padding: 8px 16px; border-radius: 7px; border: 3px solid var(--line); font-weight: 600; font-size: 15px; z-index: 4; text-align: center; max-width: 92vw; pointer-events: none !important; }
.alert-bar.red { background: rgba(200,20,40,.92); animation: blink 1s infinite; }
.alert-bar.yellow { background: rgba(170,130,10,.92); }
/* grito del apagón (La Guiteras) */
.shout { position: absolute; left: 0; right: 0; top: 24%; z-index: 30; pointer-events: none; text-align: center; animation: shout 2.1s ease-out forwards; }
.shout b { display: block; font-family: var(--disp); font-style: italic; font-weight: 800; font-size: min(22vw, 150px); line-height: .95; color: #ffd331; letter-spacing: 1px;
  -webkit-text-stroke: min(1.2vw, 8px) #0a0c13; paint-order: stroke fill; text-shadow: 0 min(1vw, 8px) 0 #0a0c13; transform: rotate(-4deg); }
.shout span { display: inline-block; margin-top: 6px; padding: 4px 14px; font-family: var(--disp); font-style: italic; font-weight: 800; font-size: min(7vw, 40px); color: #0a0c13; background: #ffc21a; border: 3px solid #0a0c13; transform: skewX(-8deg); }
.shout.on b { color: #9dff7a; }
@keyframes shout { 0% { transform: scale(.2); opacity: 0; } 9% { transform: scale(1.18); opacity: 1; } 14% { transform: scale(.96) translateX(-6px); } 19% { transform: scale(1.03) translateX(6px); } 24% { transform: scale(1) translateX(-3px); } 30% { transform: scale(1); } 78% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.12); opacity: 0; } }
@keyframes shoutq { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .shout { animation: shoutq 2.1s linear forwards; } }
@keyframes blink { 50% { filter: brightness(1.35); } }
.wait-banner { position: absolute; left: 50%; top: calc(62px + var(--safe-t)); transform: translateX(-50%); background: var(--panel); border: 3px solid var(--line); border-radius: 7px; padding: 8px 14px; font-weight: 600; font-size: 14px; z-index: 3; text-align: center; max-width: 92vw; }

/* lobby */
.lobby-panel { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); width: min(440px, 96vw); background: var(--panel); border: 3px solid var(--line); border-radius: 10px; box-shadow: 0 6px 0 var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lp-code { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.lp-code b { font-size: 23px; letter-spacing: 3px; color: #fff; margin-left: 2px; text-shadow: 0 3px 0 var(--line); vertical-align: -2px; }
.tag { font-size: 12px; background: rgba(255,255,255,.12); border-radius: 4px; padding: 2px 8px; margin-left: 4px; vertical-align: middle; }
.lp-code .tag { font-size: 13px; padding: 1px 4px; margin-left: 2px; background: none; }
.lp-bots { display: flex; align-items: center; gap: 4px; }
.lp-count { border: 2px solid rgba(255,255,255,.18); background: rgba(0,0,0,.25); color: #fff; border-radius: 6px; padding: 5px 9px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.lp-count:hover { background: rgba(255,255,255,.1); }
.lp-bots .btn.ic { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; border-radius: 6px; }
.lp-row { display: flex; gap: 6px; align-items: center; }
.lp-row .wa { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }
.lp-row .btn.ic, .lp-row .emo-tg { flex: 0 0 auto; width: 46px; height: 46px; padding: 0; font-size: 20px; border-radius: 7px; }
.lp-row .emo-tg { font-size: 23px; box-shadow: 0 4px 0 var(--line); }
.lp-emo { display: contents; }
.lp-wait { text-align: center; font-size: 13.5px; color: var(--muted); }
.lp-wait.hidden { display: none; }

/* botones de acción */
.actions { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: grid; grid-template-columns: repeat(2, auto); gap: 10px; z-index: 4; direction: rtl; }
.abtn { direction: ltr; position: relative; width: 92px; height: 92px; border-radius: 12px; border: 4px solid var(--line); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--line); touch-action: none; transition: filter .15s, opacity .15s, transform .08s; }
.abtn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.abtn .ic { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.abtn .lb { font-size: 12px; font-weight: 700; margin-top: 4px; letter-spacing: .3px; }
.abtn .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; text-shadow: 0 0 6px #000, 0 2px 0 #000; }
.abtn .cd:empty { display: none; }
.abtn.use { background: linear-gradient(#5d7bff, #3a4fd1); }
.abtn.report { background: linear-gradient(#ff9a3a, #e0611a); }
.abtn.kill { background: linear-gradient(#ff4d5e, #b81a2b); }
.abtn.sab { background: linear-gradient(#a14dff, #6b1fd1); }
.abtn.role.sher { background: linear-gradient(#ffcf3a, #d99a00); color: #2a1a00; }
.abtn.role.doc { background: linear-gradient(#3ddc84, #17a050); }
.abtn.off { filter: grayscale(.85) brightness(.6); opacity: .75; }
.abtn.kill:not(.off):not(.hidden) { animation: kready 1s ease-in-out infinite; }
.abtn.report:not(.off):not(.hidden) { animation: rready 1.2s ease-in-out infinite; }
@keyframes kready { 0%, 100% { box-shadow: 0 5px 0 var(--line), 0 0 0 0 rgba(255,60,80,.0); } 50% { box-shadow: 0 5px 0 var(--line), 0 0 22px 6px rgba(255,60,80,.75); } }
@keyframes rready { 0%, 100% { box-shadow: 0 5px 0 var(--line), 0 0 0 0 rgba(255,154,58,0); } 50% { box-shadow: 0 5px 0 var(--line), 0 0 20px 5px rgba(255,154,58,.7); } }
@media (prefers-reduced-motion: reduce) { .abtn.kill:not(.off), .abtn.report:not(.off), .role-title, .role::after { animation: none !important; } }
.sab-menu { position: absolute; right: calc(110px + var(--safe-r)); bottom: calc(120px + var(--safe-b)); background: var(--panel); border: 3px solid var(--line); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 7; min-width: 200px; box-shadow: 0 6px 0 var(--line); }
.sab-title { font-weight: 700; font-size: 18px; }
#ventArrows { position: absolute; inset: 0; pointer-events: none !important; z-index: 4; }
.vent-arrow { position: absolute; transform: translate(-50%,-50%); pointer-events: auto; width: 86px; height: 86px; border-radius: 50%; border: 4px solid var(--line); background: rgba(255,59,78,.92); color: #fff; font-size: 34px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 0 var(--line); }
.vent-arrow small { font-size: 10px; line-height: 1.1; max-width: 76px; }
.vent-arrow .va { display: inline-block; line-height: 1; }
.net-banner { position: fixed; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); background: #b81a2b; border: 3px solid var(--line); border-radius: 6px; padding: 6px 14px; font-weight: 700; z-index: 90; }

/* ---------- Capas ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; }
.overlay.modal { background: rgba(4,5,10,.72); z-index: 50; padding: 12px; }
.modal-box, .task-box, .map-box { position: relative; background: var(--panel2); border: 4px solid var(--line); border-radius: 10px; box-shadow: 0 8px 0 var(--line); width: min(520px, 100%); max-height: calc(100% - 10px); overflow: auto; padding: 16px; }
.modal-title { font-size: 22px; font-weight: 700; margin: 0 44px 12px 0; }
.task-box { width: min(440px, 100%); text-align: center; display: flex; flex-direction: column; gap: 6px; }
.task-title { font-size: 20px; font-weight: 700; margin-right: 40px; text-align: left; }
.task-hint { font-size: 13px; color: var(--muted); text-align: left; }
.task-area { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; padding-top: 4px; }
.task-ok { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; background: rgba(20,60,40,.8); border-radius: 8px; animation: pop .3s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mg-cv { width: 100%; height: auto; border-radius: 7px; touch-action: none; display: block; }
.mg-label { font-weight: 600; font-size: 16px; }
.mg-range { width: 100%; height: 40px; accent-color: var(--cyan); touch-action: pan-y; }
.mg-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.mg-num { aspect-ratio: 1; border-radius: 7px; border: 3px solid var(--line); background: #313a52; color: #fff; font-size: 24px; font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.mg-num.ok { background: #2bbf62; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.mg-hold { width: 100%; touch-action: none; -webkit-touch-callout: none; }
.mg-dom { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: center; }
.mg-dom-top { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mg-dom-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.mg-tile { display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 8px; border: 3px solid var(--line); background: #f4efe0; box-shadow: 0 3px 0 var(--line); align-items: center; }
.mg-tile.solo { display: inline-flex; padding: 3px; box-shadow: none; vertical-align: middle; }
.mg-tile.bad { background: #ff8a95; animation: shake .3s; }
.mg-half { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 44px; height: 44px; padding: 4px; }
.mg-half + .mg-half { border-top: 3px solid #0a0c13; padding-top: 6px; height: 48px; }
.mg-tile.solo .mg-half { width: 32px; height: 32px; }
.mg-half i { border-radius: 50%; }
.mg-half i.p { background: #0a0c13; }
.mg-ped { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.mg-ped .btn { touch-action: none; opacity: .55; }
.mg-ped .btn.next { opacity: 1; box-shadow: 0 0 0 3px #ffd331, 0 4px 0 var(--line); }
.mg-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.mg-box { aspect-ratio: 1.25; border-radius: 8px; border: 3px solid var(--line); background: #b98a52; font-size: 34px; box-shadow: 0 3px 0 var(--line); color: #2a1c0c; padding: 2px; }
.mg-box.open { background: #3b2f25; color: #e9d9c2; box-shadow: none; }
.mg-box.open small { font-size: 13px; font-weight: 700; line-height: 1.05; display: block; }
.mg-box.win { background: #ffd331; }
.mg-hold.held { filter: brightness(1.3); transform: translateY(3px); }
.mg-wait { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: center; }
.mg-files { font-size: 36px; }
.mg-bar { width: 100%; height: 22px; border: 3px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.4); overflow: hidden; }
.mg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #45e3ff, #3ddc84); }
.mg-lights { display: flex; gap: 10px; }
.mg-lights i { width: 22px; height: 22px; border-radius: 50%; background: #3a2030; border: 3px solid var(--line); }
.mg-lights i.on { background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.mg-switches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; padding: 12px; background: #1a1f2e; border-radius: 8px; }
.mg-switches.luz { grid-template-columns: repeat(5, 1fr); background: #2a2410; }
.mg-sw { height: 92px; border-radius: 7px; border: 3px solid var(--line); background: #3a2030; position: relative; }
.mg-sw span { position: absolute; left: 50%; width: 60%; height: 40%; transform: translateX(-50%); bottom: 8%; border-radius: 5px; background: #ff4d5e; border: 3px solid var(--line); transition: bottom .12s, background .12s; }
.mg-sw.on { background: #163a26; }
.mg-sw.on span { bottom: 52%; background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }

/* mapa */
.map-box { width: min(900px, 100%); max-width: calc(100vw - 16px); padding: 12px; }
.map-title { font-weight: 700; font-size: 18px; margin: 2px 48px 8px 4px; display: flex; align-items: center; gap: 10px; }
.kbd-hint { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: auto; white-space: nowrap; }
#mapCv { display: block; margin: 0 auto; border-radius: 7px; border: 3px solid var(--line); background: #080a12; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: #dfe4ee; margin-top: 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-pin { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 11px; border: 2px solid; }
.lg-pin.task { background: #ffd331; border-color: #2a1a00; color: #2a1a00; }
.lg-pin.sab { background: #ff3b4e; border-color: #fff; color: #fff; }
.lg-me { width: 16px; height: 16px; border-radius: 50%; background: #0a0c20; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.lg-vent { width: 16px; height: 16px; border-radius: 50%; background: #1a0f30; border: 2px solid #b07cff; }
@media (max-height: 500px) { .map-title { font-size: 15px; margin-bottom: 4px; } .map-legend { margin-top: 4px; font-size: 11px; gap: 2px 12px; } .map-box { padding: 8px; } }

/* insignias con la tecla de cada acción (solo con teclado y ratón) */
.kbd { position: absolute; top: -9px; left: -9px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 4px; background: #fff; color: #1b1f3a; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font: 700 14px/22px Fredoka, "Trebuchet MS", sans-serif; text-align: center; pointer-events: none; z-index: 2; letter-spacing: 0; }
.kbd.sm { top: auto; bottom: -8px; left: -8px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 3px; font-size: 11px; line-height: 16px; box-shadow: 0 2px 0 var(--line); }
.vent-arrow .kbd { top: -4px; left: -4px; }
.sab-opt { position: relative; }
.sab-opt .kbd { top: 50%; left: auto; right: 10px; transform: translateY(-50%); }
.kbd-hint .kbd, .key-hint .kbd { position: static; display: inline-block; vertical-align: middle; transform: none; margin: 0 2px; min-width: 22px; height: 22px; line-height: 18px; font-size: 12px; box-shadow: 0 2px 0 var(--line); }
.key-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; background: rgba(18,21,31,.92); border: 3px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 5px 0 var(--line); pointer-events: none; transition: opacity .5s; }
.key-hint.fade { opacity: 0; }
@media (hover: none) and (pointer: coarse) { .kbd, .kbd-hint, .key-hint { display: none !important; } }

/* chat */
.drawer { position: fixed; left: calc(8px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); width: min(380px, calc(100vw - 16px)); height: min(380px, 60vh); background: var(--panel2); border: 4px solid var(--line); border-radius: 9px; z-index: 45; display: flex; flex-direction: column; box-shadow: 0 6px 0 var(--line); }
.drawer-head { font-weight: 700; padding: 10px 12px; position: relative; }
.drawer-head .x { top: 5px; right: 6px; width: 32px; height: 32px; font-size: 15px; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; -webkit-user-select: text; user-select: text; }
.msg { line-height: 1.3; word-break: break-word; }
.msg .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; border: 2px solid var(--line); vertical-align: -1px; }
.msg.sys { color: var(--muted); font-style: italic; font-size: 13px; }
.msg.dead { opacity: .75; color: #c3c9d8; }
.chat-form { display: flex; gap: 6px; padding: 8px; }
.chat-form .inp { font-size: 15px; padding: 8px 10px; }
.chat-form .ptt-bots { flex: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat-form .ptt-bots.rec { background: #e53950; border-color: #7a0f22; color: #fff; animation: pulse .8s infinite; }

/* reunión */
.meeting { background: rgba(3,4,9,.82); z-index: 40; padding: 8px; }
.meet { width: min(1000px, 100%); height: min(640px, 100%); background: linear-gradient(#232a3b, #161a26); border: 4px solid var(--line); border-radius: 10px; box-shadow: 0 8px 0 var(--line); display: flex; flex-direction: column; overflow: hidden; }
.meet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(0,0,0,.25); font-size: 16px; }
.mh-timer { font-weight: 700; font-size: 18px; color: var(--gold); white-space: nowrap; }
.mh-title { flex: 1; min-width: 0; }
.mh-menu { flex: none; width: 40px; height: 40px; border-radius: 6px; border: 3px solid var(--line); background: #353c52; color: #fff; font-size: 19px; line-height: 1; cursor: pointer; }
.mh-menu:active { transform: translateY(2px); }
.meet-body { flex: 1; display: flex; min-height: 0; }
.meet-left { flex: 1.6; display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 8px; }
.meet-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.mcard { position: relative; display: flex; align-items: center; gap: 6px; background: #e6e9f1; color: #151926; border: 3px solid var(--line); border-radius: 7px; padding: 5px 6px; min-height: 66px; cursor: default; box-shadow: 0 3px 0 var(--line); }
.mcard.canvote { cursor: pointer; }
.mcard.canvote:hover { background: #fff; transform: translateY(-1px); }
.mcard.dead { background: #8a86a8; opacity: .75; }
.mcard.mine { box-shadow: 0 0 0 4px var(--gold), 0 3px 0 var(--line); }
.mcard.me .mname::after { content: ' (tú)'; font-weight: 500; font-size: 11px; }
.mcard.ejected { animation: blink .6s 4, shake .4s 2; background: #ffb4bd; }
.mav { width: 50px; height: 50px; flex: 0 0 50px; }
.mname { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstat { position: absolute; right: 6px; top: 3px; font-size: 11px; font-weight: 700; color: #15843f; }
.mvoters, .voters { display: flex; flex-wrap: wrap; gap: 3px; }
.mvoters { position: absolute; left: 58px; bottom: 4px; }
.mvoters i, .voters i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; animation: vpop .35s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes vpop { from { transform: scale(0) translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.mconf { position: absolute; inset: 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-right: 8px; background: rgba(255,255,255,.55); border-radius: 6px; }
.mconf button { width: 44px; height: 44px; border-radius: 6px; border: 3px solid var(--line); font-size: 20px; font-weight: 700; color: #fff; }
.mconf .yes { background: #2bbf62; }
.mconf .no { background: #ff4d5e; }
.meet-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#btnSkip.mine { box-shadow: 0 0 0 4px var(--gold), 0 4px 0 var(--line); }
.mt-note { font-size: 14px; color: var(--muted); flex: 1; min-width: 160px; }
.meet-chat { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,.28); border-left: 3px solid var(--line); min-width: 0; min-height: 0; }
.quick { display: flex; gap: 5px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.qbtn { flex: 0 0 auto; border: 2px solid var(--line); background: #353d54; color: #fff; border-radius: 5px; padding: 5px 9px; font-size: 13px; font-weight: 600; }
.meet-intro { z-index: 42; flex-direction: column; gap: 8px; text-align: center; animation: pop .25s; overflow: hidden; }
.meet-intro.body { background: radial-gradient(circle, rgba(200,30,40,.92), rgba(60,0,10,.96)); }
.meet-intro.emer { background: radial-gradient(circle, rgba(220,120,20,.92), rgba(80,20,0,.96)); }
.mi-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.meet-intro > :not(.mi-bg) { position: relative; z-index: 1; }
.mi-title { font-size: clamp(36px, 8.4vw, 76px); font-weight: 700; text-shadow: 0 4px 0 var(--line), 0 0 28px rgba(255,255,255,.35); animation: slam .5s cubic-bezier(.2,1.5,.4,1) both, shake .45s .5s 2; padding: 0 10px; }
.mi-av { width: 170px; height: 170px; animation: miAv .9s .15s ease-out both; }
.mi-sub { font-size: 20px; font-weight: 600; animation: kfade .4s .35s both; }
@keyframes slam { 0% { transform: scale(3) rotate(-7deg); opacity: 0; filter: blur(6px); } 60% { transform: scale(.9) rotate(2deg); opacity: 1; filter: blur(0); } 100% { transform: none; opacity: 1; } }
@keyframes miAv { 0% { transform: scale(.3) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes kfade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* rol */
.role { z-index: 41; flex-direction: column; text-align: center; padding: 16px; overflow: hidden; }
.role::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.16) 50%, transparent 65%); transform: translateX(-110%); animation: sweep 1.3s .3s ease-out both; }
@keyframes sweep { to { transform: translateX(110%); } }
.role-title { animation: glow 1.4s ease-in-out .4s infinite alternate; }
.role.imp .role-title { animation: glow 1.4s ease-in-out .4s infinite alternate, hb 1.1s .2s infinite; }
@keyframes glow { from { text-shadow: 0 6px 0 var(--line), 0 0 0 transparent; } to { text-shadow: 0 6px 0 var(--line), 0 0 34px currentColor; } }
@keyframes hb { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.07); } 24% { transform: scale(1); } 36% { transform: scale(1.05); } }
.role.crew { background: radial-gradient(circle, #1d4a8a, #050a20 75%); }
.role.imp { background: radial-gradient(circle, #8a1d2e, #14040a 75%); }
.role-in { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pop .35s; }
.role-kicker { font-size: 16px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 3px; }
.role-title { font-size: clamp(52px, 13vw, 112px); font-weight: 700; letter-spacing: 3px; text-shadow: 0 6px 0 var(--line); }
.role.crew .role-title { color: var(--cyan); }
.role.imp .role-title { color: var(--red); }
.role.sher { background: radial-gradient(circle, #7a5a10, #120c02 75%); }
.role.sher .role-title { color: var(--gold); }
.role.doc { background: radial-gradient(circle, #186a45, #03120b 75%); }
.role.doc .role-title { color: var(--ok); }
.role.eng { background: radial-gradient(circle, #7a4210, #140902 75%); }
.role.eng .role-title { color: #ff9a3a; }
.role.jes { background: radial-gradient(circle, #7a1a6a, #12030f 75%); }
.role.jes .role-title { color: #ff7ad9; }
.role-sub small { opacity: .8; }
.role-sub { font-size: 18px; max-width: 560px; }
.role-team, .end-team { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; max-width: 760px; }
.rt { display: flex; flex-direction: column; align-items: center; font-size: 13px; font-weight: 600; animation: pop .4s both; }
.rt .av { width: 74px; height: 74px; }
.rt.me .av { width: 104px; height: 104px; }
.rt.me span { color: var(--gold); }

/* eliminado: escena de cine a pantalla completa */
.killed { z-index: 43; background: #0c0004; flex-direction: column; overflow: hidden; }
/* golpe seco: sin pantalla completa, solo el borde en rojo y el rótulo sobre el propio mapa */
.killed.dry { background: radial-gradient(ellipse at center, rgba(120,0,16,0) 38%, rgba(150,0,20,.72) 100%); justify-content: flex-start; pointer-events: none; animation: kdry 1.3s ease-out both; }
.killed.dry .k-txt { position: static; margin-top: max(12vh, calc(70px + var(--safe-t))); }
.killed.dry .k-title { font-size: clamp(44px, min(13vw, 15vh), 96px); letter-spacing: 3px; animation: slam .32s cubic-bezier(.2,1.6,.4,1) both; text-shadow: 0 5px 0 #2a0008, 0 0 26px rgba(255,40,60,.55); }
.killed.dry .k-title::after { content: ''; display: block; height: 6px; width: 62%; margin: 2px auto 0; background: #ff3b4e; border-radius: 3px; }
.killed.dry .k-sub { font-size: clamp(15px, 3.4vw, 22px); animation: kfade .25s .16s both; margin-top: 6px; }
@keyframes kdry { 0% { opacity: 0; } 9% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .killed.dry, .killed.dry .k-title, .killed.dry .k-sub { animation: none; } }
/* mientras sale el rótulo, los avisos de arriba se apartan (quedaban encima del título) */
#ovKill.dry:not(.hidden) ~ #toasts, #ovKill.kcam:not(.hidden) ~ #toasts, #killMini:not(.hidden) ~ #toasts { opacity: 0; }
/* cámara de eliminación: la escena llena la pantalla y el rótulo entra al final */
.killed.kcam { background: #07080d; }
.killed.kcam .k-txt { bottom: max(7%, calc(14px + var(--safe-b, 0px))); }
.killed.kcam .k-title { font-size: clamp(40px, min(12vw, 13vh), 92px); letter-spacing: 3px; animation: slam .32s cubic-bezier(.2,1.6,.4,1) both; text-shadow: 0 5px 0 #2a0008, 0 0 26px rgba(255,40,60,.6); }
.killed.kcam .k-sub { font-size: clamp(15px, 3.2vw, 22px); animation: kfade .25s both; }
#killMini { position: fixed; left: 50%; top: calc(92px + var(--safe-t)); transform: translateX(-50%); width: min(40vw, 340px); aspect-ratio: 5 / 3; z-index: 41; border: 3px solid var(--line); border-radius: 8px; overflow: hidden; pointer-events: none; box-shadow: 0 0 0 2px #ff3b4e, 0 8px 0 rgba(0,0,0,.45); background: #07080d; animation: kmini .18s ease-out both; }
#killMini canvas { display: block; width: 100%; height: 100%; }
@keyframes kmini { from { opacity: 0; transform: translateX(-50%) scale(.6); } to { opacity: 1; transform: translateX(-50%); } }
@media (max-height: 520px) { #killMini { top: auto; bottom: calc(10px + var(--safe-b, 0px)); width: min(34vw, 46vh, 300px); } }
@media (max-width: 560px) and (min-height: 521px) { #killMini { width: min(56vw, 300px); } }
@media (prefers-reduced-motion: reduce) { .killed.kcam .k-title, .killed.kcam .k-sub { animation-name: kstill; } #killMini { animation: none; } }
#killCv { position: absolute; inset: 0; width: 100%; height: 100%; }
.k-txt { position: absolute; left: 0; right: 0; bottom: 10.5%; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.k-title { font-size: clamp(46px, min(15vw, 18vh), 124px); font-weight: 700; color: #fff; text-shadow: 0 6px 0 #4a0010, 0 0 30px var(--kill-glow, rgba(255,60,80,.6)); animation: slam .55s cubic-bezier(.2,1.6,.4,1) both, jit .5s 1; text-align: center; line-height: 1.05; max-width: 94vw; }
.k-title.long { font-size: clamp(34px, min(9.4vw, 12.5vh), 84px); }
.k-sub { text-align: center; padding: 0 12px; font-size: clamp(16px, 2.6vh, 21px); text-shadow: 0 2px 0 #000; animation: kfade .4s both; }
@keyframes kstill { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .k-title { animation-name: kstill, none; animation-timing-function: ease-out; }
  .k-sub { animation-name: kstill; }
}
@keyframes jit { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 2px) rotate(-1deg); } 40% { transform: translate(5px, -2px) rotate(1deg); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }

/* expulsión */
.eject { z-index: 44; background: #05060f; }
#ejectCv { position: absolute; inset: 0; width: 100%; height: 100%; }
.ej-text { position: relative; text-align: center; font-size: clamp(20px, 4.5vw, 34px); font-weight: 700; text-shadow: 0 3px 0 #000; padding: 0 16px; margin-top: 34vh; min-height: 3em; }

/* final */
.end { z-index: 46; flex-direction: column; text-align: center; padding: 16px; overflow-y: auto; justify-content: flex-start; }
.end > .end-in { margin: auto 0; } /* centrado si cabe; si no, se puede desplazar desde arriba */
.end-rain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.end-in { position: relative; z-index: 1; }
.end.win { background: radial-gradient(circle, #1f6a4a, #04120c 75%); }
.end.lose { background: radial-gradient(circle, #6a1f2a, #12040a 75%); }
.end-in { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .35s; }
.end-title { font-size: clamp(48px, 12vw, 100px); line-height: 1.05; font-weight: 700; text-shadow: 0 6px 0 var(--line); color: var(--gold); }
.end.lose .end-title { color: #ff8a95; }
.end-sub { font-size: 18px; }
.end-imps { font-size: 17px; margin-top: 6px; }
.end-imps b { color: var(--red); }
.end-btns { margin-top: 8px; }
.end-timer { font-size: 14px; color: var(--muted); }
.end-roles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 760px; margin-top: 4px; }
.rtag { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 5px; border: 2px solid var(--line); background: #313a52; }
.rtag.imp { background: #8a1d2e; }
.rtag.sher { background: #8a6a10; }
.rtag.doc { background: #17804a; }
.rtag.eng { background: #9a5212; }
.rtag.jes { background: #8a1d7a; }

/* modales específicos */
.cust-top { display: flex; gap: 12px; align-items: center; }
.cust-prev { width: 120px; height: 120px; flex: 0 0 120px; background: radial-gradient(circle, rgba(110,140,200,.35), transparent 70%); border-radius: 50%; }
.cust-name { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cust-name label { font-size: 13px; color: var(--muted); }
.cust-lvl { font-size: 13px; color: var(--gold); font-weight: 600; }
.cust-sec { font-weight: 700; margin: 12px 0 6px; }
.cust-tabs { display: flex; gap: 4px; margin-top: 12px; padding: 4px; background: rgba(0,0,0,.25); border-radius: 7px; }
.cust-tabs .ct { flex: 1 1 0; min-width: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; padding: 8px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cust-tabs .ct.on { background: #454e67; color: #fff; box-shadow: 0 2px 0 var(--line); }
.cust-tab > .cust-sec:first-child { margin-top: 10px; }
.cust-hint { font-size: 13px; color: var(--muted); margin: 10px 0 8px; }
.cust-sec small { font-weight: 500; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--line); position: relative; }
.sw.sel { box-shadow: 0 0 0 4px #fff, 0 3px 0 var(--line); }
.sw.taken { opacity: .3; }
.sw.taken::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #000; }
.moods { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.mood { position: relative; aspect-ratio: 1; border-radius: 7px; border: 3px solid var(--line); background: #353d54; padding: 0; overflow: hidden; min-width: 0; }
.mood.sel { background: #4f7dff; box-shadow: 0 0 0 3px #fff; }
.mood-av { width: 100%; height: 100%; display: block; }
.mood-auto { font-size: 17px; line-height: 1; }
.mood-n { color: var(--gold) !important; font-weight: 600 !important; }
.hats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.hat { position: relative; aspect-ratio: 1; border-radius: 7px; border: 3px solid var(--line); background: #353d54; padding: 0; }
.hat.sel { background: #4f7dff; box-shadow: 0 0 0 3px #fff; }
.hat.locked { background: #1f2431; }
.hat.locked .hat-av { opacity: .3; }
.hat-av { width: 100%; height: 100%; display: block; }
.hat .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
#custSave { width: 100%; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule-grp { border: 2px solid rgba(255,255,255,.14); border-radius: 7px; padding: 8px 10px; }
.rule-grp summary { cursor: pointer; font-weight: 700; }
.rule-grp[open] { display: flex; flex-direction: column; gap: 8px; }
.rule-grp[open] summary { margin-bottom: 2px; }
.rule { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; }
.rule select { width: auto; min-width: 120px; }
.chk { width: 26px; height: 26px; accent-color: var(--pri); }
.plist { display: flex; flex-direction: column; gap: 6px; }
.prow { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.2); border-radius: 6px; padding: 4px 8px; }
.prow .av { width: 44px; height: 44px; }
.pname { flex: 1; font-weight: 600; }
.plv { color: var(--gold); margin-left: 6px; }
.howto { font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; gap: 10px; }
.howto h4 { margin: 12px 0 4px; }
.howto ul { margin: 6px 0 2px; padding-left: 20px; }
.howto p { margin: 0; }
.ht-lead { font-size: 16px; }
.ht-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ht-c { display: flex; flex-direction: column; gap: 4px; border-radius: 7px; padding: 10px 12px; border: 2px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); font-size: 14px; line-height: 1.35; }
.ht-c b:first-child { font-size: 16px; }
.ht-c.crew { border-color: rgba(69,227,255,.45); }
.ht-c.imp { border-color: rgba(255,90,106,.55); background: rgba(120,20,40,.22); }
.ht-c.vote { border-color: rgba(255,211,49,.5); }
.ht-win { font-size: 14px; color: #fff6b0; }
.howto details { border: 2px solid rgba(255,255,255,.12); border-radius: 6px; padding: 6px 10px; font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto .ht-cred { border: 0; padding: 0; }
.howto .ht-cred summary { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.publist { display: flex; flex-direction: column; gap: 8px; }
.pubrow { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.2); border-radius: 6px; padding: 8px 10px; }
.pubrow > div:first-child { flex: 1; min-width: 0; }
.pubrow small { display: block; color: var(--muted); }
.pubcnt { font-weight: 700; }
.create, .menu { display: flex; flex-direction: column; gap: 10px; }
/* menú: accesos en cuadrícula, ajustes plegados */
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.mn-t { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 78px; padding: 8px 6px; border: 3px solid var(--line); border-radius: 8px; background: linear-gradient(#454e67, #2c3346); color: #fff; box-shadow: 0 4px 0 var(--line); font-weight: 600; font-size: 14px; line-height: 1.15; text-align: center; }
.mn-t:hover { filter: brightness(1.12); }
.mn-t:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.mn-t.go { background: linear-gradient(#35d46b, #1ea952); }
.mn-i { font-size: 26px; line-height: 1; }
.mn-set { border: 2px solid rgba(255,255,255,.16); border-radius: 8px; padding: 8px 12px; }
.mn-set summary { cursor: pointer; font-weight: 700; padding: 2px 0; }
.mn-set-in { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 4px; }
/* reunión: el botón de reacciones va al principio de la fila de frases */
.mt-qrow { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 8px 0; min-width: 0; }
.mt-qrow .quick { flex: 1; min-width: 0; padding: 0; }
.mt-emo { display: contents; }
.mt-qrow .emo-tg { width: 36px; height: 34px; font-size: 20px; border-radius: 6px; box-shadow: 0 2px 0 var(--line); border-width: 2px; }
.mt-qrow .emo-pop { left: 8px; transform: none; }

/* avisos */
#toasts { position: fixed; left: 50%; top: calc(110px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 95; pointer-events: none; width: max-content; max-width: 92vw; transition: opacity .15s; }
.toast { background: rgba(22,26,38,.96); border: 3px solid var(--line); border-radius: 7px; padding: 8px 14px; font-weight: 600; font-size: 15px; text-align: center; animation: pop .25s; transition: opacity .4s, transform .4s; }
.toast.err { background: rgba(170,20,40,.96); }
.toast.gold { background: linear-gradient(90deg, #b8860b, #e0a812); color: #1a1200; }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- Responsivo ---------- */
@media (max-width: 720px), (max-height: 520px) {
  .abtn { width: 76px; height: 76px; border-radius: 10px; }
  .abtn .ic { font-size: 28px; }
  .abtn .lb { font-size: 10px; }
  .ibtn { width: 40px; height: 40px; font-size: 17px; border-radius: 6px; }
  .meet-body { flex-direction: column; }
  .meet-left { flex: 1.3; padding: 6px; }
  .meet-chat { flex: 1; border-left: 0; border-top: 3px solid var(--line); }
  .meet-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
  .mcard { min-height: 54px; }
  .mav { width: 40px; height: 40px; flex-basis: 40px; }
  .mname { font-size: 13px; }
  .mvoters { left: 46px; }
  .meet-head { font-size: 13px; padding: 6px 10px; }
  .mh-timer { font-size: 15px; }
  .tasks { font-size: 12px; max-height: 32vh; }
  .alert-bar, .wait-banner { font-size: 13px; top: calc(56px + var(--safe-t)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .home-wrap { max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "logo act" "inv act" "prof act" "msg act" "links act"; align-content: center; column-gap: 18px; row-gap: 8px; padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  .home-wrap > .logo { grid-area: logo; max-height: 30vh; }
  .home-wrap > .invite { grid-area: inv; }
  .home-wrap > .profile { grid-area: prof; }
  .home-wrap > .home-actions { grid-area: act; align-self: center; }
  .home-wrap > .home-msg { grid-area: msg; }
  .home-wrap > .home-links { grid-area: links; }
  .end-title { font-size: 54px; }
  .end-in { gap: 5px; }
  .end-sub { font-size: 15px; }
  .end-hl { max-width: 760px; }
  .hl { flex-basis: 220px; padding: 4px 12px 4px 6px; }
  .hl-av canvas { width: 46px; height: 46px; }
  .hl-av.many canvas { width: 40px; height: 40px; }
  .hl-n { font-size: 16px; }
  .end-mine { font-size: 15px; }
  .end-btns .btn.big { font-size: 19px; padding: 7px 16px; }
  .lobby-panel { left: auto; right: calc(8px + var(--safe-r)); top: calc(58px + var(--safe-t)); bottom: auto; transform: none; width: min(330px, 44vw); padding: 8px 10px; gap: 6px; max-height: calc(100vh - 66px); }
  .lobby-panel > .emo-pop { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; transform: none; }
  .lp-row .wa { font-size: 14px; }
  .lp-wait { font-size: 12px; }
  .meet-body { flex-direction: row; }
  .meet-chat { border-top: 0; border-left: 3px solid var(--line); }
  .lobby-panel { width: min(410px, 58vw); padding: 6px 10px; gap: 6px; }
  .lp-code b { font-size: 21px; }
  .btn.big { font-size: 20px; padding: 9px 14px; }
  .tasks { max-height: 46vh; width: min(260px, 38vw); }
  .prog { width: min(260px, 38vw); }
  .sab-menu { bottom: calc(90px + var(--safe-b)); right: calc(90px + var(--safe-r)); }
}
@media (max-width: 420px) {
  .btn.wa { font-size: 15px; }
  .meet-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== Chat de voz ===================== */
.ibtn.voice .vic { display: inline-block; transition: transform .15s; }
.ibtn.voice.off .vic { filter: grayscale(1); opacity: .7; }
.ibtn.voice.off::after { content: '+'; position: absolute; right: -6px; top: -7px; width: 19px; height: 19px; border-radius: 50%; background: #3ddc84; color: #0b2a14; border: 2px solid var(--line); font: 700 15px/15px Fredoka, "Trebuchet MS", sans-serif; text-align: center; }
.ibtn.voice.live { background: linear-gradient(#2fbf6b, #17773f); }
.ibtn.voice.muted { background: linear-gradient(#ff5b6b, #a3192a); }
.ibtn.voice.ptt { background: rgba(34,40,56,.92); }
.ibtn.voice.ptt.open { background: linear-gradient(#2fbf6b, #17773f); }
.ibtn.voice.talk { box-shadow: 0 0 0 4px rgba(61,220,132,.6), 0 0 20px rgba(61,220,132,.85); }
.ibtn.voice.talk .vic { transform: scale(1.15); }
.ibtn.voice.busy, .ibtn.voice.unlock { animation: pulse .9s infinite; }
.ibtn.voice.unlock::before { content: '🔈 Toca para oír'; position: absolute; top: 52px; right: 0; white-space: nowrap; background: var(--gold); color: #2a1a00; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; border: 2px solid var(--line); }
.mcard.talk { box-shadow: 0 0 0 4px #3ddc84, 0 0 22px rgba(61,220,132,.75), 0 3px 0 var(--line); }
.mcard .mvc, .vtag { font-size: 12px; }
.btn.vgo { background: linear-gradient(#3ddc84, #1d8f4f); }
.menu-voice { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px dashed rgba(255,255,255,.18); border-radius: 8px; }
.mv-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.perf-hud { position: fixed; left: calc(6px + var(--safe-l)); bottom: calc(4px + var(--safe-b)); z-index: 96; font: 600 11px/1.3 ui-monospace, Menlo, Consolas, monospace; color: #b8ffcf; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.perf-hud:empty { display: none; }
.mv-row input[type=range] { flex: 1; min-width: 140px; accent-color: #3ddc84; }
.mv-row .kbd { position: static; display: inline-block; vertical-align: middle; transform: none; margin: 0 2px; min-width: 22px; height: 22px; line-height: 18px; font-size: 12px; box-shadow: 0 2px 0 var(--line); }

/* IA de los bots */
.rules p.small, p.muted.small { font-size: 12.5px; margin: -2px 0 8px; line-height: 1.35; }
.msg .mvoz { font-size: 0.85em; filter: saturate(0.8); }

/* ---------- reacciones con emoji ---------- */
.end-emo, .emo-row { display: flex; gap: 4px; justify-content: center; flex-wrap: nowrap; }
.emo-row { padding: 4px 8px 0; }
.emo-btn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 6px; border: 2px solid var(--line); background: rgba(255,255,255,.1); font: 22px/1 "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; display: flex; align-items: center; justify-content: center; padding: 0; transition: transform .08s, background .15s; touch-action: manipulation; }
.emo-btn:hover { background: rgba(255,255,255,.22); }
.emo-btn:active { transform: scale(.86); }
.end-emo .emo-btn { width: 46px; height: 46px; font-size: 26px; }
.mcard .emo-pop { position: absolute; left: 6px; top: 50%; margin-top: -21px; font: 38px/1 "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; pointer-events: none; z-index: 3; animation: emoPop 2.2s ease-out forwards; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
@keyframes emoPop { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 12% { transform: scale(1.3) rotate(8deg); opacity: 1; } 22% { transform: scale(1) rotate(0); } 50% { transform: scale(1.08) translateY(-3px); } 78% { opacity: 1; transform: scale(1) translateY(-5px); } 100% { transform: scale(.7) translateY(-8px); opacity: 0; } }
.emo-stream { position: fixed; left: 0; right: 0; bottom: 0; height: 60vh; pointer-events: none; z-index: 48; overflow: hidden; }
.emo-fly { position: absolute; bottom: 4vh; display: flex; flex-direction: column; align-items: center; animation: emoFly 3s ease-out forwards; }
.emo-fly .ef-e { font: 54px/1 "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
.emo-fly .ef-n { font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; }
@keyframes emoFly { 0% { transform: translateY(20px) scale(.3); opacity: 0; } 12% { transform: translateY(0) scale(1.15); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-34vh) scale(.9) rotate(8deg); opacity: 0; } }

/* ---------- final: lo que te pasó, MVP y resumen ---------- */
.end-mine { font-size: 18px; font-weight: 700; color: #fff6b0; margin-top: 2px; }
.end-mvp { font-size: 16px; background: rgba(255,211,49,.14); border: 2px solid rgba(255,211,49,.5); border-radius: 6px; padding: 4px 12px; }
.end-mvp b { color: var(--gold); }
.end-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.end-sum { max-width: 560px; width: 100%; text-align: left; background: rgba(0,0,0,.28); border-radius: 6px; padding: 6px 12px; font-size: 14px; }
.end-sum summary { cursor: pointer; font-weight: 700; text-align: center; padding: 2px 0; }
.end-sum ol { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 26vh; overflow-y: auto; }
.end-sum .es-t { display: inline-block; min-width: 38px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-prev { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cp-wait { min-height: 220px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: var(--muted); animation: cpWait 1s ease-in-out infinite alternate; }
@keyframes cpWait { from { opacity: .55; } to { opacity: 1; } }
.card-prev img { width: auto; max-width: 100%; max-height: min(62vh, 640px); border-radius: 7px; border: 3px solid var(--line); box-shadow: 0 6px 0 var(--line); }
.cp-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lp-last { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#endClip.pop { animation: btnPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes btnPop { 0% { transform: scale(.5); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.clip-gal { display: flex; flex-direction: column; gap: 12px; }
.cg-it { background: rgba(0,0,0,.25); border: 2px solid var(--line); border-radius: 7px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.cg-it video { display: block; width: 100%; max-height: 46vh; background: #000; border-radius: 5px; }
.cg-row { display: flex; align-items: center; gap: 8px; }
.cg-l { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cg-l small { color: var(--muted); font-size: 12px; }

/* ---------- clips ---------- */
.clip-toast { position: fixed; left: 50%; top: calc(58px + var(--safe-t)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 3px solid var(--line); border-radius: 8px; box-shadow: 0 5px 0 var(--line); padding: 8px 10px 8px 12px; animation: ctIn .35s cubic-bezier(.2,1.5,.4,1); max-width: calc(100vw - 16px); }
.clip-toast .ct-ic { font-size: 26px; }
.clip-toast .ct-tx { display: flex; flex-direction: column; line-height: 1.15; font-size: 15px; }
.clip-toast .ct-tx small { font-size: 12px; color: var(--muted); }
.clip-toast .ct-x { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 4px; }
@keyframes ctIn { from { transform: translate(-50%, -20px) scale(.8); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (max-width: 420px) { .emo-btn { width: 36px; height: 36px; font-size: 20px; } }
.show-sm { display: none; }
@media (max-width: 360px) { .hide-xs { display: none; } }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .end-btns { flex-wrap: nowrap; width: 100%; gap: 6px; }
  .end-btns .btn.big { flex: 1 1 0; min-width: 0; font-size: 19px; padding: 10px 6px; border-radius: 8px; white-space: nowrap; }
  .end-btns .emo-tg { width: 48px; height: 48px; }
  .hl { flex-basis: 100%; max-width: 360px; }
  .end-mine { font-size: 16px; }
  .end-emo .emo-btn { width: 38px; height: 38px; font-size: 21px; }
  .end-emo { gap: 3px; }
}

/* ---------- Cuenta (progreso guardado en el servidor) ---------- */
.lvl-btn { display: flex; flex-direction: column; gap: 1px; background: none; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 6px; text-align: left; color: var(--gold); font: inherit; font-size: 13px; font-weight: 600; min-width: 0; }
.lvl-btn #lvlText { white-space: nowrap; }
.lvl-btn:hover, .lvl-btn:focus-visible { background: rgba(255,255,255,.07); }
.lvl-btn .xpbar { display: block; }
.prof-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-btn { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--cyan); background: rgba(69,227,255,.12); border: 2px solid rgba(69,227,255,.4); border-radius: 5px; padding: 2px 9px; white-space: nowrap; }
.acc-btn:hover, .acc-btn:focus-visible { background: rgba(69,227,255,.22); }
.acc-btn:disabled { opacity: .6; }
.acc { display: flex; flex-direction: column; gap: 10px; }
.acc-wait { padding: 26px 8px; text-align: center; color: var(--muted); font-weight: 600; }
.acc-top { display: flex; gap: 12px; align-items: center; }
.acc-av { width: 76px; height: 76px; flex: 0 0 76px; background: radial-gradient(circle, rgba(110,140,200,.35), transparent 70%); border-radius: 50%; }
.acc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-name { font-size: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-lv { font-size: 15px; font-weight: 700; color: var(--gold); }
.acc-lv small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acc-cell { background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.08); border-radius: 6px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acc-cell b { font-size: 17px; }
.acc-cell span { font-size: 11.5px; color: var(--muted); line-height: 1.15; }
.acc-cloud { font-size: 13.5px; background: rgba(69,227,255,.1); border: 2px solid rgba(69,227,255,.35); border-radius: 6px; padding: 7px 10px; line-height: 1.3; }
.acc-cloud.warn { background: rgba(255,59,78,.14); border-color: rgba(255,59,78,.5); }
.acc-sec { font-weight: 700; margin-top: 2px; }
.acc-code-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acc-code-row .btn { flex: 1 0 auto; }
.acc-code { flex: 1 1 230px; min-width: 0; white-space: nowrap; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: clamp(16px, 4.6vw, 21px); font-weight: 700; letter-spacing: .5px; text-align: center; background: rgba(0,0,0,.35); border: 2px dashed rgba(255,211,49,.6); border-radius: 6px; padding: 8px 6px; color: #fff6b0; -webkit-user-select: all; user-select: all; overflow-wrap: anywhere; }
.acc-note { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.acc-login { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-login .inp { flex: 1 1 215px; min-width: 0; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 16px; letter-spacing: .5px; text-transform: uppercase; padding: 9px 10px; }
.acc-login .btn { flex: 1 0 auto; }
.acc-ask { background: rgba(255,211,49,.1); border: 2px solid rgba(255,211,49,.45); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.3; }
.acc-ask b { color: #fff6b0; }
.acc-link { align-self: center; background: none; border: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 4px; }
.acc-more { border: 2px solid rgba(255,255,255,.14); border-radius: 7px; padding: 8px 10px; }
.acc-more summary { cursor: pointer; font-weight: 700; }
.acc-more-in { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.acc-link:hover { color: var(--txt); }
.end-xp { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 16px; margin-top: 2px; }
.end-xp b { color: var(--gold); }
.end-xp span { font-weight: 600; color: #fff6b0; }
.end-xp i { display: block; width: 110px; height: 9px; border-radius: 3px; background: rgba(255,255,255,.14); border: 2px solid var(--line); overflow: hidden; }
.end-xp u { display: block; height: 100%; background: linear-gradient(90deg, #ffd331, #ff8a1f); }

/* ---------- Misiones, racha, tienda y mascotas ---------- */
.mis-row .btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; line-height: 1.15; padding: 6px 4px 8px; font-size: 15.5px; }
.mis-row .btn .ti { display: block; height: 27px; font-size: 23px; line-height: 27px; }
.mis-row .btn small { display: block; max-width: 100%; margin-top: 2px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.btn.mis { background: linear-gradient(to top, #ff8a2f 4px, rgba(0,0,0,0) 4px), linear-gradient(#343c51, #222837); }
.btn.shop { background: linear-gradient(to top, #a76bff 4px, rgba(0,0,0,0) 4px), linear-gradient(#343c51, #222837); }
.btn.rank { background: linear-gradient(to top, #ffc21a 4px, rgba(0,0,0,0) 4px), linear-gradient(#343c51, #222837); }
.tile-b { position: absolute; top: -10px; right: -6px; padding: 0 6px; border: 2px solid var(--line); border-radius: 5px; background: linear-gradient(#ff7a2f, #d9381a); color: #fff; font-size: 12.5px; line-height: 19px; box-shadow: 0 2px 0 var(--line); pointer-events: none; }
/* ranking semanal */
.rk-top { display: flex; gap: 8px; align-items: stretch; }
.rk-me { flex: 1; min-width: 0; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.12); border-radius: 6px; padding: 7px 10px; font-size: 13.5px; line-height: 1.3; }
.rk-me b { color: var(--gold); font-size: 17px; }
.rk-left { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; text-align: center; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.12); border-radius: 6px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.rk-left b { font-size: 15px; color: #fff; white-space: nowrap; }
.rk-prz { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 9px 0 4px; }
.rk-prz span { background: rgba(255,211,49,.12); border: 2px solid rgba(255,211,49,.4); border-radius: 5px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rk-pod { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 6px; align-items: end; margin: 8px 0 8px; }
.rk-p { text-align: center; min-width: 0; }
.rk-p canvas { display: block; width: 92px; max-width: 100%; height: 80px; margin: 0 auto -2px; }
.rk-p .rk-n { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-p .rk-x { font-size: 12.5px; font-weight: 600; color: var(--gold); }
.rk-p .rk-st { margin-top: 4px; border: 3px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; padding-top: 5px; font-size: 22px; line-height: 1; }
.rk-p.p1 .rk-st { height: 62px; background: linear-gradient(#ffe066, #e8a30f); }
.rk-p.p2 .rk-st { height: 46px; background: linear-gradient(#eef2f8, #98a6bb); }
.rk-p.p3 .rk-st { height: 34px; background: linear-gradient(#f3b98a, #b8692b); }
.rk-p.me .rk-n { color: #fff6b0; }
.rk-p.none canvas { visibility: hidden; }
.rk-p.none .rk-n, .rk-p.none .rk-x { color: var(--muted); font-weight: 500; }
.rk-list { display: flex; flex-direction: column; gap: 4px; }
.rk-row { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border-radius: 5px; background: rgba(255,255,255,.05); }
.rk-row.me { background: rgba(255,211,49,.18); box-shadow: inset 0 0 0 2px rgba(255,211,49,.6); }
.rk-row .rk-pos { flex: 0 0 30px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-row canvas { flex: 0 0 34px; width: 34px; height: 34px; }
.rk-row .rk-n { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-row .rk-n small { color: var(--muted); font-weight: 500; margin-left: 5px; font-size: 12px; }
.rk-row .rk-x { font-weight: 700; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-empty { text-align: center; padding: 16px 8px 10px; color: var(--muted); line-height: 1.4; }
.rk-last { margin-top: 10px; text-align: center; font-size: 13.5px; background: rgba(255,211,49,.1); border: 2px solid rgba(255,211,49,.4); border-radius: 6px; padding: 6px 10px; }
.rk-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.4; }
@media (max-width: 340px) {   /* teléfonos muy angostos: que quepan las filas de dos botones */
  .home-actions .row:not(.mis-row) .btn { padding-left: 8px; padding-right: 8px; font-size: 14px; }
  .home-actions .row { gap: 8px; }
}
/* personalizar: mascota y eliminación */
.pets { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pet-b { position: relative; aspect-ratio: 1; border-radius: 7px; border: 3px solid var(--line); background: #353d54; padding: 0; color: #fff; }
.pet-b.none span { font-size: 18px; opacity: .8; }
.pet-b.sel { background: #4f7dff; box-shadow: 0 0 0 3px #fff; }
.pet-b.locked { background: #1f2431; }
.pet-b.locked .pet-av { opacity: .3; }
.pet-av { width: 100%; height: 100%; display: block; }
.pet-b .lock, .kill-b .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.kill-b { position: relative; border-radius: 7px; border: 3px solid var(--line); background: #353d54; padding: 4px 2px 5px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.kill-b.sel { background: #4f7dff; box-shadow: 0 0 0 3px #fff; }
.kill-b.locked { background: #1f2431; }
.kill-b.locked .kill-av { opacity: .3; }
.kill-av { width: 100%; height: 44px; display: block; }
.kill-ic { font-size: 26px; height: 44px; display: flex; align-items: center; }
.kill-n { font-size: 11.5px; font-weight: 600; line-height: 1.1; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* misiones */
.mis { display: flex; flex-direction: column; gap: 10px; }
.mis-top { display: flex; gap: 10px; align-items: center; }
.mis-streak { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.12); }
.mis-streak b { font-size: 24px; line-height: 1.1; }
.mis-streak span { font-size: 11px; color: var(--muted); text-align: center; }
.mis-streak.on { background: rgba(255,138,31,.16); border-color: rgba(255,138,31,.6); }
.mis-st { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; display: flex; flex-direction: column; gap: 2px; }
.mis-next { color: #fff6b0; }
.mis-best { color: var(--muted); font-size: 12px; }
.mis-coins { flex: 0 0 auto; font-size: 15px; background: rgba(255,211,49,.14); border: 2px solid rgba(255,211,49,.5); border-radius: 6px; padding: 4px 10px; }
.mis-coins b { color: var(--gold); font-size: 18px; }
.mis-list { display: flex; flex-direction: column; gap: 8px; }
.mis-card { background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); border-radius: 7px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.mis-card.done { background: rgba(61,220,132,.12); border-color: rgba(61,220,132,.55); }
.mis-h { display: flex; gap: 8px; align-items: center; }
.mis-ck { font-size: 18px; }
.mis-t { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.mis-rw { flex: 0 0 auto; text-align: right; font-weight: 700; color: var(--gold); font-size: 14px; line-height: 1.1; }
.mis-rw small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.mis-bar { position: relative; height: 16px; border-radius: 4px; background: rgba(0,0,0,.35); border: 2px solid var(--line); overflow: hidden; }
.mis-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc84, #a6ee3a); }
.mis-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.mis-rr { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border-radius: 5px; border: 2px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); font-size: 16px; line-height: 1; color: #fff; }
.mis-rr:hover { background: rgba(255,255,255,.18); }
.mis-bonus { text-align: center; font-weight: 600; font-size: 14px; padding: 7px 10px; border-radius: 6px; background: rgba(255,211,49,.1); border: 2px dashed rgba(255,211,49,.5); }
.mis-bonus.done { background: rgba(61,220,132,.12); border: 2px solid rgba(61,220,132,.55); }
.mis-foot { text-align: center; font-size: 12.5px; color: var(--muted); }
.mis-foot a, .shop-tip a { color: var(--cyan); }
/* tienda */
.shop { display: flex; flex-direction: column; gap: 6px; }
.shop-top { display: flex; gap: 10px; align-items: center; }
.shop-coins { flex: 0 0 auto; font-size: 17px; background: rgba(255,211,49,.14); border: 2px solid rgba(255,211,49,.5); border-radius: 6px; padding: 5px 12px; }
.shop-coins b { color: var(--gold); font-size: 22px; }
.shop-tip { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.3; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-card { background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); border-radius: 7px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.shop-card.own { border-color: rgba(79,125,255,.7); }
.shop-card.using { background: rgba(79,125,255,.22); }
.shop-av { width: 100%; height: 70px; display: block; }
.shop-n { font-weight: 700; font-size: 13.5px; text-align: center; line-height: 1.15; }
.shop-d { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.shop-ver { padding: 3px 10px !important; font-size: 12px !important; }
.shop-b { width: 100%; margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px !important; padding-right: 4px !important; }
.shop-pv { position: relative; border-radius: 7px; overflow: hidden; border: 3px solid var(--line); margin-top: 4px; }
.shop-pvc { width: 100%; height: 190px; display: block; background: #3d0010; }
.shop-pvx { width: 32px; height: 32px; font-size: 15px; top: 6px; right: 6px; }
/* final: premios */
.end-rw { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 720px; margin: 2px auto 0; }
/* final: el impostor y el mejor jugador, de un vistazo */
.end-sub small { font-size: 15px; color: var(--muted); }
.end-hl { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; max-width: 640px; margin-top: 6px; }
.hl { flex: 1 1 230px; max-width: 310px; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.16); border-radius: 9px; padding: 6px 14px 6px 8px; animation: pop .4s both; }
.hl + .hl { animation-delay: .12s; }
.hl.imp { background: rgba(120,20,40,.45); border-color: rgba(255,90,106,.7); }
.hl.mvp { background: rgba(255,211,49,.12); border-color: rgba(255,211,49,.6); }
.hl.jes { background: rgba(138,29,122,.38); border-color: rgba(230,80,210,.65); }
.hl-av { flex: 0 0 auto; display: flex; }
.hl-av canvas { width: 62px; height: 62px; }
.hl-av.many canvas { width: 50px; height: 50px; margin-right: -16px; }
.hl-av.many canvas:last-child { margin-right: 0; }
.hl-tx { min-width: 0; }
.hl-k { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hl-n { font-size: 19px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.hl.imp .hl-n { color: #ff8a95; }
.hl.mvp .hl-n { color: var(--gold); }
.hl.jes .hl-n { color: #ff9cf0; }
.hl-w { font-size: 13px; line-height: 1.25; color: #fff6b0; }
.end-btns { position: relative; align-items: center; }
.end-sum .end-roles { margin: 6px 0 4px; }
/* reacciones: un botón 😀 que abre la fila de emojis encima */
.emo-tg { flex: 0 0 auto; width: 50px; height: 50px; padding: 0; border-radius: 8px; border: 3px solid var(--line); background: rgba(255,255,255,.12); box-shadow: 0 3px 0 var(--line); font: 26px/1 "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.emo-tg:hover { background: rgba(255,255,255,.22); }
.emo-tg.on { background: var(--gold); }
.emo-pop { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 20; display: flex; gap: 4px; padding: 6px; background: var(--panel2); border: 3px solid var(--line); border-radius: 8px; box-shadow: 0 5px 0 var(--line); animation: pop .18s; }
.emo-pop.hidden { display: none; }
.end-rw span { background: rgba(0,0,0,.35); border: 2px solid rgba(255,211,49,.55); border-radius: 6px; padding: 4px 10px; font-size: 14px; font-weight: 600; }
@media (max-width: 420px) {
  .pets { grid-template-columns: repeat(4, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .mis-top { flex-wrap: wrap; }
  .mis-st { flex-basis: calc(100% - 90px); }
  .mis-coins { margin-left: auto; }
  .end-rw span { font-size: 12.5px; }
}
.btn.confirm { background: linear-gradient(#ffd331, #ff9a1f); color: #2a1600; animation: glowc 0.9s ease-in-out infinite; }
@keyframes glowc { 0%, 100% { box-shadow: 0 4px 0 var(--line), 0 0 0 0 rgba(255,211,49,.0); } 50% { box-shadow: 0 4px 0 var(--line), 0 0 0 5px rgba(255,211,49,.55); } }

/* Cámaras de seguridad */
.modal-box:has(.cams) { width: min(760px, 100%); }
.cams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cam { position: relative; border: 3px solid var(--line); border-radius: 6px; overflow: hidden; background: #05070f; line-height: 0; }
.cam canvas { width: 100%; height: auto; display: block; aspect-ratio: 4 / 3; }
.cam-tag { position: absolute; left: 6px; top: 6px; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .3px; color: #fff; background: rgba(0,0,0,.55); padding: 4px 6px; border-radius: 3px; }
.cam-tag i { width: 7px; height: 7px; border-radius: 50%; background: #ff2b3d; animation: camrec 1s steps(2) infinite; }
@keyframes camrec { 50% { opacity: .2; } }
.cams p { margin: 8px 0 0; text-align: center; }
@media (orientation: landscape) and (max-height: 500px) { .cams-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } .cam-tag { font-size: 9px; } }

/* Menú de sabotaje con cuatro opciones: en pantallas bajas (teléfono en horizontal) va en dos columnas para que quepa */
@media (max-height: 520px) {
  .sab-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; width: min(380px, calc(100vw - 200px)); }
  .sab-menu .sab-title, .sab-menu .muted { grid-column: 1 / -1; }
  .sab-menu .sab-opt { padding-top: 8px; padding-bottom: 8px; font-size: 15px; }
}
/* con teclado, que el texto largo («Comunicaciones») no se meta debajo de la tecla */
@media (hover: hover) and (pointer: fine) {
  .sab-menu { min-width: 250px; }
  .sab-menu .sab-opt { padding-left: 14px; padding-right: 42px; }
}
/* teléfono en vertical: el aviso de sabotaje va debajo de la fila de tareas, no encima */
@media (max-width: 520px) and (orientation: portrait) {
  .alert-bar { top: calc(106px + var(--safe-t)); max-width: 94vw; width: max-content; }
}
/* teléfono en horizontal: el aviso va en la fila de arriba, entre la barra de tareas y los botones */
@media (max-height: 520px) and (orientation: landscape) {
  .alert-bar { top: calc(6px + var(--safe-t)); left: calc(min(260px, 38vw) + 18px + var(--safe-l)); transform: none; max-width: calc(100vw - min(260px, 38vw) - 236px - var(--safe-l) - var(--safe-r)); padding: 5px 12px; }
}

/* ---------- Estilo de acción: títulos en condensada cursiva (la fuente va en assets/fonts) ---------- */
@font-face { font-family: 'Barlow Condensed'; font-style: italic; font-weight: 800; font-display: swap; src: url('../fonts/barlow-condensed-800-italic.woff2') format('woff2'); }
.mi-title, .role-title, .k-title, .end-title, .btn.big { font-family: var(--disp); font-style: italic; font-weight: 800; }
.btn.big { letter-spacing: .6px; }
