@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'),
       url('../../../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2'),
       url('../../../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2'),
       url('../../../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2'),
       url('../../../assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lalezar';
  src: url('/assets/fonts/Lalezar-Regular.woff2') format('woff2'),
       url('../../../assets/fonts/Lalezar-Regular.woff2') format('woff2'),
       url('/assets/fonts/Lalezar-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --u-bg:           #09080e;
  --u-bg-card:      #13111c;
  --u-bg-surface:   #171424;
  --u-bg-sidebar:   #0d0b14;
  --u-border:       rgba(255, 255, 255, 0.08);
  --u-border-hover: rgba(139, 92, 246, 0.3);
  --u-pink:         #a855f7;
  --u-pink-dim:     rgba(168, 85, 247, 0.12);
  --u-purple:       #8b5cf6;
  --u-purple-dim:   rgba(139, 92, 246, 0.12);
  --u-cyan:         #a78bfa;
  --u-green:        #10b981;
  --u-amber:        #f59e0b;
  --u-text:         #f8fafc;
  --u-text-muted:   #94a3b8;
  --u-font:         'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  --u-radius:       12px;
  --u-radius-sm:    8px;
  --u-shadow-card:  0 4px 20px rgba(0, 0, 0, 0.35);
  --u-shadow-glow:  none;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--u-font);
  background-color: var(--u-bg);
  color: var(--u-text);
  min-height: 100vh;
  direction: rtl;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  background-image: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

.user-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.user-sidebar {
  width: 268px;
  background: var(--u-bg-sidebar);
  border-left: 1px solid var(--u-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--u-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sidebar-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.player-card {
  padding: 18px;
  border-bottom: 1px solid var(--u-border);
  display: flex;
  align-items: center;
  gap: 13px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.player-head {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: #0b0e14;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.player-ign {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 6px;
  align-self: flex-start;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.rank-default { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
.rank-vip     { background: rgba(34, 197, 94, 0.12);   color: #86efac; border: 1px solid rgba(34, 197, 94, 0.25); }
.rank-void    { background: rgba(56, 189, 248, 0.12);  color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.25); }
.rank-abyss   { background: rgba(168, 85, 247, 0.12);  color: #c4b5fd; border: 1px solid rgba(168, 85, 247, 0.25); }
.rank-vanta   { background: rgba(236, 72, 153, 0.12);  color: #f9a8d4; border: 1px solid rgba(236, 72, 153, 0.25); }

.rank-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.rank-expiry-text {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.sidebar-nav {
  list-style: none;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--u-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--u-text-muted);
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid transparent;
}

.sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.sidebar-nav-link.active {
  background: #1c182e;
  color: #c4b5fd;
  font-weight: 700;
  box-shadow: none;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.sidebar-nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #8b5cf6;
  border-radius: 3px 0 0 3px;
}

.sidebar-nav-link svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar-nav-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--u-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--u-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--u-text-muted);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.sidebar-footer-link:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--u-border);
  color: var(--u-text);
}

.sidebar-footer-link.logout {
  color: #fda4af;
}

.sidebar-footer-link.logout:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.user-main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--u-border);
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

.topbar-title p {
  font-size: 13px;
  color: var(--u-text-muted);
  margin-top: 3px;
}

@media (max-width: 900px) {
  .user-layout {
    flex-direction: column;
  }

  .user-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .player-card {
    flex: 1;
    min-width: 200px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
    gap: 4px;
  }

  .sidebar-nav-link::before {
    display: none;
  }

  .sidebar-footer {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .user-main {
    padding: 18px 16px;
  }
}
