:root{
  --bg0: rgba(7,9,14,.72);
  --bg1: rgba(12,14,22,.92);
  --brd: rgba(255,255,255,.10);
  --brd2: rgba(255,255,255,.16);
  --txt: #e7eaee;
  --mut: rgba(231,234,238,.72);
  --gold: #f3c300;
  --gold2:#ffd970;
  --shadow: 0 18px 45px rgba(0,0,0,.35);
}

.te-nav{
  position:fixed;
  top:12px;
  left:12px;
  right:12px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  border-radius:18px;
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  border:1px solid var(--brd);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  z-index:1000;
  opacity:0;
  transform:translateY(-8px);
  transition: opacity .35s ease, transform .35s ease, background .25s ease, border-color .25s ease;
}

.te-nav.is-visible{opacity:1;transform:none}

.te-nav.sticky{
  background: linear-gradient(180deg, rgba(8,10,16,.80), rgba(10,12,18,.96));
  border-color: rgba(255,255,255,.12);
}

.nav-left,
.nav-center,
.nav-auth{
  display:flex;
  align-items:center;
}

.nav-left{
  gap:10px;
  min-width: 220px;
  flex: 0 0 auto;
}

.nav-logo{
  width:42px;
  height:42px;
  border-radius:12px;
  object-fit:contain;
  filter: drop-shadow(0 0 10px rgba(243,195,0,.25)) brightness(1.15);
  transition: transform .18s ease, filter .18s ease;
}

.nav-logo:hover{
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 0 14px rgba(243,195,0,.55)) brightness(1.22);
}

.logo-text{
  font-weight:950;
  letter-spacing:.2px;
  font-size:1.02rem;
  white-space:nowrap;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  text-shadow: 0 0 18px rgba(243,195,0,.10);
}

.nav-center{
  flex: 1 1 auto;
  justify-content:center;
  gap:10px;
  list-style:none;
  margin:0;
  padding:0;
}

.nav-center li{display:flex}

.nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:36px;
  padding:0 12px;
  border-radius:999px;
  text-decoration:none;
  font-weight:850;
  font-size:.95rem;
  color: rgba(231,234,238,.78);
  border:1px solid transparent;
  background: transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-link:hover{
  color: var(--txt);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

.nav-link.active{
  color: #111;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 10px 28px rgba(243,195,0,.22);
}

.nav-auth{
  gap:10px;
  min-width: 220px;
  justify-content:flex-end;
  flex: 0 0 auto;
}

.login-discord{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:40px;
  padding:0 14px;
  border-radius:999px;
  text-decoration:none;
  font-weight:950;
  color:#fff;
  background: linear-gradient(90deg, rgba(88,101,242,.92), rgba(114,137,218,.92));
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 30px rgba(88,101,242,.18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  white-space:nowrap;
}

.login-discord:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(88,101,242,.28);
  filter: brightness(1.04);
}

.nav-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 10px 6px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.nav-user img{
  width:30px;
  height:30px;
  border-radius:50%;
  display:block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.10);
}

.nav-info{display:flex;flex-direction:column;line-height:1}

.nav-name-row{
  display:flex;
  align-items:center;
  gap:8px;
}

.nav-name{
  font-weight:900;
  font-size:.92rem;
  color: var(--txt);
  max-width: 160px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nav-rank{
  position:relative;
  display:inline-flex;
  align-items:center;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:.78rem;
  font-weight:950;
  letter-spacing:.02em;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  color: var(--txt);
  white-space:nowrap;
  line-height:1;
}

.nav-rank::after{
  content:attr(data-tooltip);
  position:absolute;
  left:50%;
  top:calc(100% + 10px);
  transform:translateX(-50%) translateY(-4px);
  min-width:220px;
  max-width:340px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(10,12,18,.92);
  border:1px solid rgba(255,255,255,.12);
  color: var(--txt);
  font-size:12.5px;
  line-height:1.35;
  white-space:pre-line;
  box-shadow: 0 18px 50px rgba(0,0,0,.48);
  backdrop-filter: blur(12px);
  opacity:0;
  pointer-events:none;
  transition: opacity .16s ease, transform .16s ease;
  z-index:9999;
}

.nav-rank::before{
  content:"";
  position:absolute;
  left:50%;
  top:calc(100% + 4px);
  transform:translateX(-50%) rotate(45deg);
  width:10px;
  height:10px;
  background: rgba(10,12,18,.92);
  border-left:1px solid rgba(255,255,255,.12);
  border-top:1px solid rgba(255,255,255,.12);
  opacity:0;
  transition: opacity .16s ease;
  z-index:9999;
}

.nav-rank:hover::after{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

.nav-rank:hover::before{opacity:1}

.logout-btn{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--txt);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.logout-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}

.menu-toggle{
  display:none;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--txt);
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.menu-toggle:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}

.menu-toggle .bar{
  width:20px;
  height:2px;
  background: var(--txt);
  border-radius:2px;
  position:relative;
  display:block;
}

.menu-toggle .bar::before,
.menu-toggle .bar::after{
  content:"";
  position:absolute;
  left:0;
  width:20px;
  height:2px;
  background: var(--txt);
  border-radius:2px;
}

.menu-toggle .bar::before{top:-6px}
.menu-toggle .bar::after{top:6px}

.nav-scrim{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.45);
  display:none;
  z-index:999;
}

.nav-scrim.show{display:block}

@media(max-width:980px){
  .nav-left{min-width: 160px}
  .nav-auth{min-width: 160px}
  .nav-name{max-width: 120px}
}

@media(max-width:860px){
  .te-nav{
    top:10px;
    left:10px;
    right:10px;
    padding:0 12px;
  }

  .menu-toggle{display:flex}

  .nav-auth{display:none}

  .nav-center{
    position:fixed;
    top:86px;
    left:10px;
    right:10px;
    margin:0;
    padding:12px;
    gap:10px;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    border-radius:18px;
    background: rgba(10,12,18,.96);
    border:1px solid rgba(255,255,255,.12);
    box-shadow: 0 18px 45px rgba(0,0,0,.42);
    max-height:0;
    overflow:hidden;
    transition:max-height .25s ease, padding .25s ease;
  }

  .nav-center.open{
    max-height:72vh;
    padding:14px;
  }

  .nav-center li{display:block}

  .nav-link{
    width:100%;
    height:44px;
    justify-content:flex-start;
    padding:0 14px;
    border-radius:14px;
    background: rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.08);
  }

  .nav-link.active{
    background: linear-gradient(90deg, var(--gold), var(--gold2));
    color:#111;
    border-color: rgba(255,255,255,.18);
  }

  #drawer-auth-slot{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:8px;
  }

  #drawer-auth-slot .login-discord{
    width:100%;
    justify-content:center;
  }
}

.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.75);
  align-items:center;
  justify-content:center;
  z-index:10000;
}

.modal-content{
  background: rgba(10,12,18,.95);
  color: var(--txt);
  padding: 26px 26px;
  border-radius: 16px;
  text-align: center;
  max-width: 420px;
  width: calc(100% - 40px);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}

.modal-close{
  position:absolute;
  top:12px;
  right:16px;
  font-size:24px;
  font-weight:800;
  color: rgba(231,234,238,.7);
  cursor:pointer;
}

.modal-close:hover{color: var(--txt)}
