/* ---------- Duel emotes: the button, the menu and the bubbles (js/emotes.js) ---------- */
#emotes.hidden, #emotes .hidden { display:none; }
#emotes { position:fixed; inset:0; pointer-events:none; z-index:60; font-family:'Oxanium', var(--display, sans-serif); }
#em-menu { pointer-events:auto; position:absolute; width:min(470px, calc(100vw - 16px)); display:flex; flex-direction:column; border-radius:14px; background:rgba(14,11,32,.96); border:1.5px solid rgba(150,125,255,.7); box-shadow:0 12px 34px rgba(0,0,0,.7), 0 0 22px rgba(110,80,255,.35); overflow:hidden; }
#em-menu .em-head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid rgba(190,170,255,.18); }
#em-menu .em-head b { font:700 15px inherit; font-family:inherit; letter-spacing:.2em; color:#fff; }
#em-x { width:30px; height:30px; border-radius:8px; border:1px solid rgba(190,170,255,.35); background:rgba(120,100,200,.18); color:#efeaff; font-size:14px; cursor:pointer; }
#em-x:hover { background:rgba(150,125,240,.4); }
#em-menu .em-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; padding:10px; max-height:min(62vh, 520px); overflow-y:auto; }
#em-menu .em-grid button { min-width:0; min-height:0; overflow:hidden; aspect-ratio:1; display:grid; place-items:center; padding:6px; border-radius:10px; background:rgba(30,24,64,.85); border:1px solid rgba(190,170,255,.22); cursor:pointer; color:#efeaff; font:700 16px inherit; font-family:inherit; letter-spacing:.04em; transition:transform .12s, border-color .12s, box-shadow .12s; }
#em-menu .em-grid button:hover { transform:scale(1.04); border-color:#c9bcff; box-shadow:0 0 14px rgba(150,125,255,.6); }
#em-menu .em-grid img { max-width:100%; max-height:100%; object-fit:contain; pointer-events:none; }
#em-mute { font:600 12px inherit; font-family:inherit; color:rgba(225,220,255,.62); background:none; border:0; border-top:1px solid rgba(190,170,255,.18); padding:10px; cursor:pointer; }
#em-mute:hover { color:#fff; }
.em-bub { position:absolute; display:flex; align-items:center; gap:10px; padding:8px 18px 8px 8px; border-radius:14px; background:rgba(16,12,34,.92); border:1.5px solid rgba(190,170,255,.55); box-shadow:0 8px 26px rgba(0,0,0,.6); color:#fff; font-weight:700; font-size:20px; letter-spacing:.03em; }
.em-bub.them { border-color:rgba(255,150,110,.7); }
.em-bub .em-th { height:72px; width:auto; border-radius:6px; }
.em-bub.pop { animation:emPop .28s cubic-bezier(.2,1.4,.4,1); }
@keyframes emPop { from { transform:scale(.6); opacity:0; } to { transform:scale(1); opacity:1; } }

/* your portrait is the emote button while a Duel is live */
#side-p .av.emotable { cursor:pointer; transition:transform .15s, filter .15s; }
#side-p .av.emotable:hover { transform:scale(1.08); filter:drop-shadow(0 0 4px #fff) drop-shadow(0 0 14px rgba(160,140,255,.95)); }
#side-p .av.emotable:active { transform:scale(.97); }

/* the RETREATED banner when your Rival leaves a Duel (js/duel.js) */
.retreat-banner { position:fixed; inset:0; z-index:80; display:grid; place-items:center; pointer-events:none; animation:rbOut 3.2s both; }
.retreat-banner img { width:min(78vw, 760px); height:auto; filter:drop-shadow(0 0 28px rgba(140,110,255,.7)); animation:rbIn .55s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes rbIn { from { transform:scale(.45); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes rbOut { 0%, 78% { opacity:1; } 100% { opacity:0; } }

.em-bub.sticker { padding:0; background:none; border:0; box-shadow:none; }
.em-bub.sticker img { width:min(230px, 34vh, 26vw); height:auto; filter:drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 6px 14px rgba(0,0,0,.6)); }

/* phones (short or narrow screens): more, smaller tiles so the menu doesn't fill the battle */
@media (max-height:520px), (max-width:700px) {
  #em-menu { width:min(340px, calc(100vw - 16px)); border-radius:10px; }
  #em-menu .em-head { padding:4px 8px; }
  #em-menu .em-head b { font-size:11px; }
  #em-menu .em-grid { grid-template-columns:repeat(4, minmax(0, 1fr)); gap:5px; padding:6px; max-height:min(52vh, 220px); }
  #em-menu .em-grid button { padding:2px; border-radius:7px; }
  #em-mute { padding:4px; font-size:11px; }
  .em-bub.sticker img { width:min(170px, 40vh, 30vw); }
}
