/* Amigos: botão do topo, caixa central, lista e popup de desafio de duelo. */
.btn-friends { position: relative; }
.btn-friends .friends-icon { width: 1.15rem; height: 1.15rem; }
.btn-friends .friends-spark { opacity: 0; transform-origin: 19.5px 4px; }
.btn-friends:hover .friends-spark, .btn-friends.has-news .friends-spark { opacity: 1; animation: friendsSpark 1.4s ease-in-out infinite; }
@keyframes friendsSpark { 0%, 100% { transform: scale(.6) rotate(0); opacity: .5; } 50% { transform: scale(1.15) rotate(45deg); opacity: 1; } }
.friends-badge { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.05rem; height: 1.05rem; display: grid; place-items: center; padding: 0 .25rem; border: 2px solid #0b1426; border-radius: 1rem; background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; font: 800 .58rem/1 var(--font-pixel-ui); box-shadow: 0 0 .5rem #e11d4888; }
.friends-badge[hidden] { display: none; }
html:not(.battlemon-mobile) #btnFriends { color: #f9a8d4; border-color: #f472b677; background: #2a1530; }
html:not(.battlemon-mobile) #btnFriends:hover { box-shadow: 0 0 .9rem #f472b666; border-color: #f472b6; }
html:not(.battlemon-mobile) #btnFriends.has-news { animation: friendsPulse 1.6s ease-in-out infinite; }
@keyframes friendsPulse { 50% { box-shadow: 0 0 1rem #f472b688; } }

/* ------------------------------------------------------------ caixa de amigos */
.friends-modal { z-index: 950; }
.friends-card {
  position: relative; display: flex; flex-direction: column; gap: .7rem; width: min(46rem, calc(100vw - 2rem)); max-width: 46rem; height: min(35rem, calc(100dvh - 3rem)); padding: 1rem 1.1rem 1.1rem; overflow: hidden;
  border: 1px solid #3a2b55; border-radius: 1rem; color: #e8f1ff;
  background: radial-gradient(70% 40% at 0% 0%, #f472b61f, transparent 70%), radial-gradient(60% 40% at 100% 100%, #38bdf81a, transparent 70%), linear-gradient(180deg, #14213b, #0a1424);
  box-shadow: 0 1.5rem 3.5rem #000b, 0 0 2rem #f472b61a, inset 0 1px 0 #ffffff14;
}
.friends-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem; }
.friends-head-icon { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: .8rem; color: #f9a8d4; background: linear-gradient(160deg, #3a1d44, #1a1030); border: 1px solid #f472b680; box-shadow: 0 0 1rem #f472b633; }
.friends-head-icon svg { width: 1.5rem; height: 1.5rem; }
.friends-head h2 { margin: 0; color: #fff; font: 800 1.05rem var(--font-pixel-title, var(--font-pixel-ui)); letter-spacing: .12em; text-shadow: 0 0 .8rem #f472b655; }
.friends-head small { color: #8ea4c2; font: 700 .66rem var(--font-pixel-ui); letter-spacing: .05em; }
.friends-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
.friends-add-field { display: flex; align-items: center; gap: .55rem; padding: 0 .8rem; min-height: 2.6rem; border-radius: .7rem; border: 1px solid #2c4468; background: #0b1527; transition: border-color .2s, box-shadow .2s; }
.friends-add-field:focus-within { border-color: #f472b6; box-shadow: 0 0 1rem #f472b633; }
.friends-add-field span { display: grid; color: #f9a8d4; }
.friends-add-field svg { width: 1.1rem; height: 1.1rem; }
.friends-add-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: 700 .8rem var(--font-pixel-ui); }
.friends-add-field input::placeholder { color: #5d7191; }
.friends-msg { min-height: 1.1rem; margin: -.2rem 0 0; font: 700 .68rem var(--font-pixel-ui); color: #8ea4c2; }
.friends-msg[data-tone="ok"] { color: #86efac; }
.friends-msg[data-tone="error"] { color: #fda4af; }
.friends-body { display: grid; align-content: start; gap: .9rem; flex: 1; min-height: 0; overflow-y: auto; padding: .1rem .3rem .2rem 0; scrollbar-width: thin; scrollbar-color: #3a4a6a transparent; }
.friends-section h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .45rem; padding-bottom: .35rem; border-bottom: 1px solid #ffffff10; color: #9db4d4; font: 800 .64rem var(--font-pixel-ui); letter-spacing: .1em; }
.friends-section h3 b { padding: .05rem .5rem; border-radius: 1rem; background: #f472b624; color: #f9a8d4; }
.friends-section.is-requests h3 { color: #fde68a; }
.friends-section.is-requests h3 b { background: #fbbf2422; color: #fde68a; }
.friends-empty { margin: .4rem 0; padding: 1.2rem; text-align: center; color: #7d93b2; font: 600 .74rem/1.5 var(--font-pixel-ui); border: 1px dashed #2c4468; border-radius: .8rem; }
.friend-row { display: grid; grid-template-columns: auto minmax(7rem, 1fr) auto auto; align-items: center; gap: .8rem; margin-bottom: .45rem; padding: .55rem .75rem; border-radius: .8rem; border: 1px solid #22324d; background: linear-gradient(90deg, #ffffff06, transparent), #0f1c32; transition: border-color .2s, box-shadow .2s, transform .2s; }
.friend-row:hover { border-color: #f472b655; box-shadow: 0 0 1rem #f472b618; }
.friend-row.is-request { grid-template-columns: auto minmax(0, 1fr) auto; border-color: #fbbf2455; background: linear-gradient(90deg, #fbbf2410, transparent), #0f1c32; }
.friend-row.is-pending { grid-template-columns: auto minmax(0, 1fr); opacity: .75; }
.friend-avatar { position: relative; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .8rem; background: radial-gradient(circle at 50% 30%, #23406b, #0c1626); border: 1px solid #38bdf855; }
.friend-avatar img { width: 2.4rem; height: 2.4rem; object-fit: contain; image-rendering: pixelated; }
.friend-dot { position: absolute; right: -.25rem; bottom: -.25rem; width: .75rem; height: .75rem; border-radius: 50%; background: #475569; border: 2px solid #0f1c32; }
.friend-row.is-online .friend-dot { background: #34d399; box-shadow: 0 0 .5rem #34d399; }
.friend-info { display: grid; gap: .15rem; min-width: 0; }
.friend-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font: 800 .82rem var(--font-pixel-ui); text-transform: none; }
.friend-info small { color: #7d93b2; font: 700 .6rem var(--font-pixel-ui); letter-spacing: .05em; text-transform: uppercase; }
.friend-floor { font-style: normal; padding: .08rem .45rem; border-radius: .35rem; color: #fde68a; background: #fbbf2418; border: 1px solid #fbbf2440; }
.friend-team { display: flex; align-items: center; gap: .3rem; padding: .2rem .45rem; border-radius: .7rem; background: #0a1424; border: 1px solid #22324d; }
.friend-team.is-empty { color: #5d7191; font: 700 .58rem var(--font-pixel-ui); letter-spacing: .08em; }
.friend-mon { position: relative; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .6rem; background: radial-gradient(circle at 50% 70%, #1d3354, transparent 75%); }
.friend-mon img { width: 2.4rem; height: 2.4rem; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px #0008); }
.friend-mon small { position: absolute; right: -.1rem; bottom: -.1rem; min-width: 1.15rem; padding: .02rem .2rem; border-radius: .3rem; background: #0b1527; border: 1px solid #38bdf866; color: #7dd3fc; font: 800 .5rem var(--font-pixel-ui); text-align: center; }
.friend-actions { display: flex; align-items: center; gap: .4rem; }

/* botões customizados */
.friends-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.1rem; padding: 0 .9rem; border-radius: .65rem; cursor: pointer; overflow: hidden; border: 1px solid #ffffff26; color: #e8f1ff; background: #ffffff0d; font: 800 .66rem var(--font-pixel-ui); letter-spacing: .08em; transition: transform .16s, box-shadow .2s, filter .2s, border-color .2s; }
.friends-btn svg { width: 1rem; height: 1rem; flex: none; }
.friends-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.friends-btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.friends-btn:disabled { opacity: .45; cursor: default; }
.friends-btn:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.friends-btn-add { min-height: 2.6rem; padding: 0 1.2rem; color: #2a0b1c; border-color: #fbcfe8; background: linear-gradient(180deg, #f9a8d4, #ec4899); box-shadow: 0 .18rem 0 #9d174d, 0 0 1rem #ec489944; }
.friends-btn-add:hover:not(:disabled) { box-shadow: 0 .18rem 0 #9d174d, 0 0 1.5rem #ec489988; }
.friends-btn-accept { color: #04210f; border-color: #bbf7d0; background: linear-gradient(180deg, #86efac, #22c55e); box-shadow: 0 .15rem 0 #166534, 0 0 .9rem #22c55e44; }
.friends-btn-decline { color: #fecdd3; border-color: #fb718566; background: #fb71851a; }
.friends-btn-pvp { min-width: 5.6rem; color: #fff; border-color: #fda4af; background: linear-gradient(180deg, #fb7185, #be123c); box-shadow: 0 .15rem 0 #881337, 0 0 .9rem #fb718544; text-shadow: 0 1px 0 #4c0519; }
.friends-btn-pvp::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #ffffff55 50%, transparent 65%); transform: translateX(-120%); }
.friends-btn-pvp:hover:not(:disabled)::after { animation: friendsShine .7s ease; }
.friends-btn-pvp:hover:not(:disabled) .friends-btn-swords { animation: swordsWiggle .5s ease; }
@keyframes friendsShine { to { transform: translateX(120%); } }
@keyframes swordsWiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg) scale(1.15); } 60% { transform: rotate(10deg) scale(1.15); } }
.friends-btn-remove { min-width: 2.1rem; padding: 0; color: #9db4d4; }
.friends-btn-remove:hover:not(:disabled) { color: #fda4af; border-color: #fb718588; }

/* ------------------------------------------------------------ popup de desafio */
.fd-overlay { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #3b0d1fcc, #060912ee 70%); opacity: 0; transition: opacity .25s; }
.fd-overlay[hidden] { display: none; }
.fd-overlay.is-open { opacity: 1; }
.fd-rays { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, #fb718524 0 6deg, transparent 6deg 18deg); animation: fdSpin 22s linear infinite; mask-image: radial-gradient(circle, #000 10%, transparent 62%); }
.fd-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fd-overlay.is-open .fd-flash { animation: fdFlash .55s ease-out; }
@keyframes fdSpin { to { transform: rotate(360deg); } }
@keyframes fdFlash { 0% { opacity: .75; } 100% { opacity: 0; } }
.fd-card {
  position: relative; display: grid; justify-items: center; gap: .7rem; width: min(28rem, calc(100vw - 2rem)); padding: 1.6rem 1.6rem 1.4rem; text-align: center; color: #fff;
  border: 2px solid #fb7185; border-radius: 1.1rem; background: linear-gradient(180deg, #2a1024ee, #120a1cf2);
  box-shadow: 0 0 0 4px #fb718522, 0 0 3rem #fb718555, 0 2rem 4rem #000b, inset 0 1px 0 #ffffff1f;
}
.fd-overlay.is-open .fd-card { animation: fdPop .55s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes fdPop { 0% { transform: scale(.4) rotate(-4deg); opacity: 0; } 60% { transform: scale(1.06) rotate(1deg); opacity: 1; } 100% { transform: none; } }
.fd-corner { position: absolute; width: .9rem; height: .9rem; border: 3px solid #fde047; filter: drop-shadow(0 0 .4rem #fde047); }
.fd-c1 { top: -.3rem; left: -.3rem; border-right: 0; border-bottom: 0; } .fd-c2 { top: -.3rem; right: -.3rem; border-left: 0; border-bottom: 0; }
.fd-c3 { bottom: -.3rem; left: -.3rem; border-right: 0; border-top: 0; } .fd-c4 { bottom: -.3rem; right: -.3rem; border-left: 0; border-top: 0; }
.fd-swords { display: grid; place-items: center; width: 4.6rem; height: 4.6rem; border-radius: 50%; color: #fde047; background: radial-gradient(circle, #7f1d3a, #2a1024); border: 2px solid #fb7185; box-shadow: 0 0 1.6rem #fb7185aa; animation: fdBob 1.2s ease-in-out infinite; }
.fd-swords svg { width: 2.8rem; height: 2.8rem; filter: drop-shadow(0 0 .4rem #fde047); }
.fd-swords.is-clash { animation: fdClash .9s ease-out; }
@keyframes fdBob { 50% { transform: translateY(-.35rem) rotate(4deg); } }
@keyframes fdClash { 0% { transform: scale(.3) rotate(-90deg); } 60% { transform: scale(1.25) rotate(12deg); } 100% { transform: none; } }
.fd-kicker { color: #fde047; font: 800 .66rem var(--font-pixel-ui); letter-spacing: .3em; text-shadow: 0 0 .7rem #fde04788; }
.fd-card h2 { margin: 0; font: 800 1.15rem/1.3 var(--font-pixel-title, var(--font-pixel-ui)); text-shadow: 0 .15rem 0 #7f1d3a, 0 0 1rem #fb718588; text-transform: none; }
.fd-name { color: #fda4af; }
.fd-trainer { display: flex; align-items: center; gap: .8rem; padding: .45rem 1rem .45rem .5rem; border-radius: 3rem; background: #ffffff0d; border: 1px solid #ffffff22; }
.fd-avatar { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #3b2a6b, #0c1626); border: 2px solid #fde047; box-shadow: 0 0 .9rem #fde04755; }
.fd-avatar img { width: 2.7rem; height: 2.7rem; object-fit: contain; image-rendering: pixelated; }
.fd-meta { display: grid; gap: .2rem; text-align: left; }
.fd-meta b { font: 800 .85rem var(--font-pixel-ui); text-transform: none; }
.fd-meta em { font: 800 .6rem var(--font-pixel-ui); font-style: normal; color: #fde68a; letter-spacing: .08em; }
.fd-team { justify-content: center; background: #0a1424aa; }
.fd-note, .fd-warn { max-width: 22rem; margin: 0; font: 600 .68rem/1.5 var(--font-pixel-ui); color: #b8c9e2; }
.fd-warn { color: #fda4af; }
.fd-timer { width: 100%; height: .45rem; overflow: hidden; border-radius: 1rem; background: #0b1527; border: 1px solid #ffffff1f; }
.fd-timer i { display: block; width: 100%; height: 100%; transform-origin: left; background: linear-gradient(90deg, #fb7185, #fde047); box-shadow: 0 0 .7rem #fde04788; }
.fd-actions { display: flex; gap: .8rem; width: 100%; margin-top: .3rem; }
.fd-btn { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3rem; padding: 0 1rem; overflow: hidden; border-radius: .85rem; cursor: pointer; font: 800 .78rem var(--font-pixel-ui); letter-spacing: .1em; transition: transform .16s, box-shadow .2s, filter .2s; }
.fd-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); filter: brightness(1.1); }
.fd-btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.fd-btn:disabled { opacity: .4; cursor: default; }
.fd-btn:focus-visible { outline: 3px solid #fde047; outline-offset: 3px; }
.fd-accept { color: #052e16; border: 2px solid #bbf7d0; background: linear-gradient(180deg, #86efac, #16a34a); box-shadow: 0 .25rem 0 #14532d, 0 0 1.4rem #22c55e77; animation: fdBeat 1.3s ease-in-out infinite; }
.fd-accept:disabled { animation: none; }
.fd-btn-icon { width: 1.3rem; height: 1.3rem; }
.fd-btn-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #ffffff77 50%, transparent 65%); transform: translateX(-120%); animation: friendsShine 2.2s ease-in-out infinite; }
.fd-decline { color: #cbd5e1; border: 2px solid #475569; background: linear-gradient(180deg, #1e293b, #0f172a); box-shadow: 0 .25rem 0 #020617; }
@keyframes fdBeat { 50% { box-shadow: 0 .25rem 0 #14532d, 0 0 2.2rem #22c55eaa; } }
@media (prefers-reduced-motion: reduce) { .fd-rays, .fd-swords, .fd-accept, .fd-btn-shine, .fd-overlay.is-open .fd-card, .fd-overlay.is-open .fd-flash, .btn-friends .friends-spark, #btnFriends.has-news { animation: none !important; } }
@media (max-width: 720px) { .friend-row { grid-template-columns: auto minmax(0, 1fr) auto; } .friend-team { grid-column: 1 / -1; order: 5; } }
.friend-info strong, .fd-name, .fd-meta b { text-transform: none !important; }
.fd-meta b { text-transform: uppercase !important; }
