:root{
  --bg0:#050612;
  --bg1:#070a1e;
  --panel: rgba(12, 14, 38, .62);
  --panel2: rgba(8, 9, 24, .72);
  --stroke: rgba(125, 147, 255, .20);
  --stroke2: rgba(198, 110, 255, .18);

  --blue:#5aa8ff;
  --blue2:#2b6cff;
  --violet:#b06cff;
  --violet2:#7a2cff;

  --good:#35ffa6;
  --good2:#2bd3ff;
  --bad:#ff4b6e;
  --bad2:#ff2e2e;

  --text:#eaf0ff;
  --muted:#a9b4da;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --glow: 0 0 28px rgba(90,168,255,.22);
  --glow2: 0 0 26px rgba(176,108,255,.18);

  --r: 18px;
  --r2: 26px;

  --gap: 16px;
  --max: 1180px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1100px 800px at 20% 10%, rgba(90,168,255,.18), transparent 55%),
    radial-gradient(900px 700px at 78% 18%, rgba(176,108,255,.16), transparent 58%),
    radial-gradient(900px 700px at 50% 92%, rgba(53,255,166,.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x:hidden;
}

/* Subtle “Solo Leveling vibe”: lines + noise */
body::before{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px;
  mask-image: radial-gradient(900px 560px at 50% 20%, rgba(0,0,0,1), rgba(0,0,0,.25), transparent 78%);
  opacity:.18;
  mix-blend-mode: screen;
}
body::after{
  content:"";
  position: fixed;
  inset:-20%;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity:.06;
  transform: rotate(8deg);
}

.wrap{
  width:min(var(--max), calc(100% - 28px));
  margin: 18px auto 34px;
  position: relative;
}

/* Animated particles canvas */
#fx{
  position: fixed;
  inset:0;
  width:100vw;
  height:100vh;
  pointer-events:none;
  opacity:.75;
  mix-blend-mode: screen;
  filter: saturate(1.15);
}

/* Header */
header{
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(6,7,18,.82), rgba(6,7,18,.62));
  border-bottom: 1px solid rgba(125,147,255,.14);
}
.head{
  width:min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 12px;
  display:grid;
  grid-template-columns: 320px 1fr 240px;
  gap: 12px;
  align-items: center;
}

.leftSummary{
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(12,14,38,.55), rgba(8,9,24,.62));
  border: 1px solid rgba(125,147,255,.18);
  border-radius: var(--r);
  box-shadow: var(--glow);
  position: relative;
  overflow:hidden;
}
.leftSummary::before{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(420px 220px at 20% 10%, rgba(90,168,255,.20), transparent 55%),
              radial-gradient(380px 220px at 80% 55%, rgba(176,108,255,.16), transparent 58%);
  opacity:.65;
  pointer-events:none;
}
.sumAvatarWrap{
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.sumAvatar{
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(140,120,255,.8);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  background: rgba(18,20,30,.7);
}
.sumLine{
  position: relative;
  z-index:1;
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  padding: 2px 0;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.sumLine b{
  color: var(--text);
  font-weight: 700;
  letter-spacing:.2px;
}
.sumLine .v{
  color: var(--good2);
  font-weight: 700;
  text-shadow: 0 0 16px rgba(43,211,255,.15);
}

.brand{
  text-align:center;
  padding: 6px 0;
  position: relative;
}
.brandTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 18px;
  color: var(--text);
  text-shadow: 0 0 22px rgba(90,168,255,.20), 0 0 22px rgba(176,108,255,.18);
}
.brandSub{
  font-size: 12px;
  color: rgba(169,180,218,.88);
  margin-top: 3px;
}
.brandRune{
  display:inline-block;
  margin: 0 8px;
  opacity:.8;
  filter: drop-shadow(0 0 12px rgba(176,108,255,.20));
}

.rightActions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  align-items:center;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(12,14,38,.52), rgba(8,9,24,.62));
  box-shadow: var(--glow2);
}
.dot{
  width:9px;height:9px;border-radius:999px;
  background: rgba(169,180,218,.45);
  box-shadow: 0 0 18px rgba(169,180,218,.2);
}
.dot.ok{ background: var(--good); box-shadow: 0 0 22px rgba(53,255,166,.22); }
.dot.bad{ background: var(--bad); box-shadow: 0 0 22px rgba(255,75,110,.22); }

button{
  border:0;
  cursor:pointer;
  color: var(--text);
  font-weight: 700;
  letter-spacing:.2px;
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(43,108,255,.28), rgba(176,108,255,.22));
  border: 1px solid rgba(125,147,255,.22);
  box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
button:hover{ transform: translateY(-1px); filter: brightness(1.08); }
button:active{ transform: translateY(0px) scale(.99); }
button.secondary{
  background: linear-gradient(180deg, rgba(12,14,38,.62), rgba(8,9,24,.72));
  border: 1px solid rgba(125,147,255,.18);
  box-shadow: none;
}
button.good{
  background: linear-gradient(135deg, rgba(53,255,166,.20), rgba(43,211,255,.18));
  border: 1px solid rgba(53,255,166,.22);
}
button.bad{
  background: linear-gradient(135deg, rgba(255,75,110,.22), rgba(255,46,46,.14));
  border: 1px solid rgba(255,75,110,.26);
}

/* Nav */
.navBar{
  width:min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  padding: 10px 0 14px;
}
.tabs{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: var(--r2);
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(10,12,32,.52), rgba(7,8,20,.62));
  box-shadow: var(--glow);
}
.tab{
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .35px;
  text-transform: uppercase;
  background: rgba(12,14,38,.58);
  border: 1px solid rgba(125,147,255,.14);
  color: rgba(234,240,255,.9);
  transition: transform .12s ease, background .12s ease, border .12s ease, filter .12s ease;
  user-select:none;
}
.tab:hover{ transform: translateY(-1px); filter: brightness(1.08); }
.tab.active{
  background: linear-gradient(135deg, rgba(43,108,255,.28), rgba(176,108,255,.22));
  border: 1px solid rgba(125,147,255,.24);
  box-shadow: 0 0 26px rgba(90,168,255,.14);
}

/* Main layout */
main{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 1020px){
  .head{ grid-template-columns: 1fr; }
  .rightActions{ justify-content:flex-start; }
  main{ grid-template-columns: 1fr; }
}

.card{
  border-radius: var(--r2);
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(12,14,38,.55), rgba(8,9,24,.72));
  box-shadow: var(--shadow);
  overflow:hidden;
  position: relative;
}
.card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(520px 260px at 20% 10%, rgba(90,168,255,.18), transparent 55%),
              radial-gradient(520px 260px at 80% 60%, rgba(176,108,255,.14), transparent 58%);
  opacity:.75;
  pointer-events:none;
}
.card > *{ position: relative; z-index:1; }

.cardHeader{
  padding: 16px 16px 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(125,147,255,.12);
}
.cardTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  letter-spacing: .8px;
  font-weight: 700;
  font-size: 14px;
  margin:0;
}
.cardBody{ padding: 14px 16px 16px; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px){
  .grid2{ grid-template-columns: 1fr; }
}

.stat{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(125,147,255,.16);
  background: rgba(6,7,18,.35);
}
.stat .k{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat .v{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
}
.stat.good .v{ color: var(--good); text-shadow: 0 0 20px rgba(53,255,166,.18); }
.stat.bad .v{ color: var(--bad); text-shadow: 0 0 20px rgba(255,75,110,.18); }
.stat.neutral .v{ color: var(--good2); text-shadow: 0 0 20px rgba(43,211,255,.14); }


.dashCard{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(125,147,255,.14);
  background: rgba(6,7,18,.3);
}

.bar{
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,147,255,.16);
  background: rgba(4,5,14,.55);
  overflow:hidden;
}
.bar > i{
  display:block;
  height:100%;
  width: 32%;
  background: linear-gradient(90deg, rgba(43,211,255,.75), rgba(176,108,255,.65));
  box-shadow: 0 0 18px rgba(90,168,255,.22);
}
.hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(169,180,218,.9);
  line-height: 1.45;
}

.list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.row{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(125,147,255,.14);
  background: rgba(6,7,18,.32);
}
.row .a{ font-weight: 800; }
.row .b{ color: var(--muted); font-size: 12px; }

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 999;
  max-width: min(720px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(125,147,255,.18);
  background: rgba(10,12,32,.76);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  display:none;
  gap: 10px;
  align-items: center;
}
.toast.show{ display:flex; }
.toast .badge{
  font-weight: 900;
  font-size: 11px;
  letter-spacing:.6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,147,255,.18);
  background: rgba(12,14,38,.62);
  text-transform: uppercase;
}
.toast.ok .badge{ border-color: rgba(53,255,166,.24); color: var(--good); }
.toast.bad .badge{ border-color: rgba(255,75,110,.26); color: var(--bad); }
.toast .msg{ color: rgba(234,240,255,.92); font-size: 13px; }

/* Modal login */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display:none;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
}
.modal.show{ display:grid; }
.modalBox{
  width: min(520px, 100%);
  border-radius: 26px;
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(12,14,38,.72), rgba(8,9,24,.82));
  box-shadow: 0 30px 120px rgba(0,0,0,.65);
  overflow:hidden;
  position:relative;
}
.modalBox::before{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(520px 260px at 18% 10%, rgba(90,168,255,.22), transparent 55%),
              radial-gradient(520px 260px at 80% 70%, rgba(176,108,255,.18), transparent 58%);
  opacity:.85;
  pointer-events:none;
}
.modalBox > *{ position:relative; z-index:1; }
.modalHead{
  padding: 16px 18px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(125,147,255,.12);
}
.modalHead h3{
  margin:0;
  font-family: Orbitron, Inter, system-ui, sans-serif;
  letter-spacing: .8px;
  font-size: 14px;
}
.modalBody{ padding: 14px 18px 18px; }

label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 6px;
}
input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(125,147,255,.18);
  background: rgba(4,5,14,.55);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.0);
}
input:focus{
  border-color: rgba(43,211,255,.32);
  box-shadow: 0 0 0 4px rgba(43,211,255,.10);
}

.modalActions{
  display:flex;
  gap:10px;
  margin-top: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mini{
  font-size: 12px;
  color: rgba(169,180,218,.92);
  line-height: 1.45;
  margin-top: 10px;
}
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(169,180,218,.95);
}


/* Floating reward (XP) */
.reward-float{
  position: fixed;
  transform: translate(-50%, -8px) scale(.96);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-size: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(125,147,255,.22);
  background: rgba(10,12,32,.70);
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
  text-shadow: 0 0 22px rgba(43,211,255,.18);
  transition: opacity .12s ease, transform .12s ease;
}
.reward-float.good{
  border-color: rgba(53,255,166,.26);
  box-shadow: 0 0 26px rgba(53,255,166,.16), 0 20px 70px rgba(0,0,0,.55);
}
.reward-float.bad{
  border-color: rgba(255,75,110,.30);
  box-shadow: 0 0 26px rgba(255,75,110,.16), 0 20px 70px rgba(0,0,0,.55);
  text-shadow: 0 0 22px rgba(255,75,110,.18);
}
.reward-float.show{
  opacity: 1;
  transform: translate(-50%, -18px) scale(1);
  animation: rewardFloatUp 1.05s ease forwards;
}
.reward-float.hide{
  opacity: 0;
}
@keyframes rewardFloatUp{
  0%{ filter: brightness(1.0); }
  25%{ filter: brightness(1.15); }
  100%{ transform: translate(-50%, -54px) scale(1.02); opacity: 0; }
}

/* Missions: keep your place + “system confirmation” glow */
.row.mission-completed{
  border-color: rgba(53,255,166,.20);
  background: rgba(8, 22, 18, .26);
}
.row.flash-good{
  animation: missionFlashGood 900ms ease;
}
@keyframes missionFlashGood{
  0%{
    box-shadow: 0 0 0 rgba(0,0,0,0);
    filter: brightness(1);
  }
  20%{
    box-shadow:
      0 0 0 1px rgba(53,255,166,.18),
      0 0 34px rgba(53,255,166,.18),
      0 0 46px rgba(43,211,255,.14);
    filter: brightness(1.12);
  }
  100%{
    box-shadow: 0 0 0 rgba(0,0,0,0);
    filter: brightness(1);
  }
}
/* =========================
   Landing ( / )
   ========================= */
.landing{
  position: relative;
  min-height: calc(100vh - 1px);
  display: grid;
  place-items: center;
  padding: 28px 14px;
}

.landingBg{
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 18% 12%, rgba(90,168,255,.22), transparent 55%),
    radial-gradient(900px 700px at 80% 18%, rgba(176,108,255,.20), transparent 58%),
    radial-gradient(900px 700px at 50% 92%, rgba(53,255,166,.09), transparent 60%);
  filter: saturate(1.1);
}

.landingWrap{
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (max-width: 980px){
  .landingWrap{ grid-template-columns: 1fr; }
}

.landingHero{
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(12,14,38,.52), rgba(8,9,24,.72));
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

.landingTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 22px;
  text-shadow: 0 0 22px rgba(90,168,255,.20), 0 0 22px rgba(176,108,255,.18);
}

.landingRune{
  display:inline-block;
  margin: 0 8px;
  opacity:.85;
  filter: drop-shadow(0 0 14px rgba(176,108,255,.22));
}

.landingSub{
  margin-top: 6px;
  color: rgba(169,180,218,.92);
  line-height: 1.45;
}

.landingTips{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.landingTip{
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(125,147,255,.14);
  background: rgba(6,7,18,.32);
  color: rgba(234,240,255,.9);
}

.landingCard{
  border-radius: 26px;
  border: 1px solid rgba(125,147,255,.18);
  background: linear-gradient(180deg, rgba(12,14,38,.62), rgba(8,9,24,.78));
  box-shadow: 0 30px 120px rgba(0,0,0,.55);
  overflow: hidden;
}

.landingCardHead{
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(125,147,255,.12);
}

.landingCardTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  letter-spacing: .8px;
  font-weight: 700;
  font-size: 14px;
}

.landingCardHint{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(169,180,218,.92);
}

.landingCardBody{ padding: 14px 18px 18px; }

.landingLabel{
  display:block;
  font-size: 12px;
  color: rgba(169,180,218,.92);
  margin: 10px 0 6px;
}

.landingInput{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(125,147,255,.18);
  background: rgba(4,5,14,.55);
  color: #eaf0ff;
  outline: none;
}

.landingInput:focus{
  border-color: rgba(43,211,255,.32);
  box-shadow: 0 0 0 4px rgba(43,211,255,.10);
}

.landingActions{
  display:flex;
  gap:10px;
  margin-top: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.landingMini{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(169,180,218,.92);
  line-height: 1.45;
}

.landingLinks{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}
.landingLinks .dotSep{ opacity:.55; }

button.link{
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--good2);
  font-weight: 800;
  letter-spacing: .2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.link:hover{ filter: brightness(1.15); transform:none; }

/* Modal (login/cadastro/recuperação) */
.modal{ position: fixed; inset:0; z-index: 100; }
.modalBackdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.modalCard{
  position: relative;
  width: min(520px, calc(100% - 28px));
  margin: 8vh auto 0;
  background: linear-gradient(180deg, rgba(12,14,38,.82), rgba(8,9,24,.86));
  border: 1px solid rgba(125,147,255,.22);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modalHead{
  padding: 14px 14px 12px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  border-bottom: 1px solid rgba(125,147,255,.16);
}
.modalTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
}
.modalBody{ padding: 14px; }

.formGrid{ display:grid; gap: 10px; }
.hint{ font-size: 12px; color: rgba(169,180,218,.92); line-height: 1.45; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* Esconde layout do app quando estiver na landing */
body.is-landing header,
body.is-landing .wrap{
  display:none !important;
}
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid #6c5ce7;
  object-fit: cover;
}
/* Clan - controls inline (select padrão do site) */
.row select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  min-width: 140px;
}

.row select:focus {
  border-color: rgba(120, 200, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(120, 200, 255, 0.12);
}

.row select option {
  color: #111; /* options normalmente renderizam em UI nativa; isso ajuda no Win/Chrome */
}

/* ===== Chat Dock (fixo à esquerda) ===== */
.chatDockToggle{
  position: fixed;
  left: 10px;
  bottom: 14px;
  z-index: 50;

  width: 80px;
  height: 80px;
  border-radius: 50%;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(18,20,30,0.72);
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: visible; /* permite badge de não lidas ficar por cima do ícone */
}

.chatDockToggle::after{
  z-index: 3;
}

.chatDockToggleIcon{
  position: relative;
  z-index: 1;
  width: 80%;   /* ajuste fino: 50% a 62% */
  height: 80%;
  object-fit: contain;
  display: block;
}
.chatDockToggle.has-unread::after{
  content: attr(data-unread);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff4b6e;
  color: #fff;
  border: 3px solid rgba(255,255,255,0.3);
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.chatDockToggle.open{
  left: 530px; /*Posição do icone do chat`*/
}

.chatDockDmNotice{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  min-width: 290px;
  max-width: 440px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(14,18,28,0.95);
  box-shadow: 0 14px 34px rgba(0,0,0,0.38);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.chatDockDmNotice.show{
  opacity: 1;
  transform: translateY(0);
}
.chatDockDmNotice .t{
  font-size: 14px;
  font-weight: 700;
  color: rgba(236,242,255,0.95);
}
.chatDockDmNotice .b{
  margin-top: 4px;
  font-size: 13px;
  color: rgba(200,214,244,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatPresenceDot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 8px;
  background: #8a93aa;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset;
}
.chatPresenceDot.is-online{
  background: #27e49a;
  box-shadow: 0 0 10px rgba(39,228,154,0.65);
  animation: chatPresencePulse 1.35s ease-in-out infinite;
}
.chatPresenceDot.is-offline{
  background: #ff5a6c;
  box-shadow: 0 0 0 1px rgba(255,90,108,0.25), 0 0 10px rgba(255,90,108,0.22);
}

@keyframes chatPresencePulse{
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39,228,154,0.70); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(39,228,154,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39,228,154,0); }
}

.chatDockFriendOnlineNotice{
  position: fixed;
  right: 16px;
  bottom: 90px;
  z-index: 121;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(14,18,28,0.95);
  box-shadow: 0 14px 34px rgba(0,0,0,0.38);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chatDockFriendOnlineNotice.show{
  opacity: 1;
  transform: translateY(0);
}
.chatDockFriendOnlineNotice .avatar{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
}
.chatDockFriendOnlineNotice .text .t{
  font-size: 14px;
  font-weight: 700;
  color: rgba(236,242,255,0.95);
}
.chatDockFriendOnlineNotice .text .b{
  margin-top: 2px;
  font-size: 13px;
  color: rgba(200,214,244,0.9);
}


.chatDock{
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 550px; /*Aumenta o tamanho do chat*/
  z-index: 49;
  transform: translateX(-100%);
  transition: transform .18s ease;
  pointer-events: none;
}
.chatDock.open{
  transform: translateX(0);
  pointer-events: auto;
}

.chatDockInner{
  height: 100%;
  display:flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(12,14,22,0.92);
  border-right: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
}

.chatDockHeader{
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.chatDockTopBar{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.chatDockSearchList{
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
}
.chatDockTitle{
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: .8px;
  font-size: 12px;
  text-transform: uppercase;
  opacity: .9;
}
.chatDockTabs{
  display:flex;
  gap: 6px;
}
.chatDockTabs button{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  position: relative;
}
.chatDockTabs button.has-unread::after{
  content: attr(data-unread);
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff4b6e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.24);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.chatDockBody{
  flex:1;
  display:flex;
  min-height: 0;
}
.chatDockLeft{
  width: 140px;
  border-right: 1px solid rgba(255,255,255,0.10);
  padding: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.chatDockCompose input{
  padding: 10px 12px;
}
.chatDockList{
  overflow:auto;
  min-height: 0;
}
.chatDockRow{
  display:flex;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  cursor:pointer;
  margin-bottom: 8px;
}
.chatDockRow:hover{
  border-color: rgba(120,200,255,0.35);
}
.chatDockRight{
  flex:1;
  padding: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.chatDockMsgs{
  flex:1;
  overflow:auto;
  min-height: 0;
  padding-right: 4px;
}
.chatDockMsg{
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 8px;
}
.chatDockMsg.me{
  border-color: rgba(120,200,255,0.22);
  background: rgba(120,200,255,0.06);
}
.chatDockSendRow input{
  padding: 10px 12px;
}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 18px;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  font-size: 11px;
  line-height: 1;
}

/* Ajuste: quando dock aberto, não esmagar header/wrap (só dá um respiro) */
body.chat-dock-open header,
body.chat-dock-open .wrap{
  margin-left: 560px;
  width: calc(100% - 560px);
}
@media (max-width: 920px){
  body.chat-dock-open header,
  body.chat-dock-open .wrap{
    margin-left: 0;
    width: 100%;
  }

  /* Mobile: chat toggle icon is free-positioned */
  .chatDockToggle{
    left: auto;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    top: auto;
  }
  .chatDockToggle.open{
    left: auto;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    top: auto;
  }

  .chatDock{
    width: 100%;
    height: 100dvh;
  }
  .chatDockRight{
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile notifications on top */
  .toast{
    top: calc(10px + env(safe-area-inset-top, 0px));
    bottom: auto;
    transform: translateX(-50%);
  }

  .chatDockDmNotice{
    top: calc(10px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 12px;
    right: 12px;
    min-width: 0;
    max-width: none;
  }

  .chatDockFriendOnlineNotice{
    top: calc(84px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 12px;
    right: 12px;
    min-width: 0;
    max-width: none;
  }
}