:root {
  --sidebar-width: 230px;
  --sidebar-collapsed-width: 60px;
  --sidebar-transition: 0.25s ease;
  --surface-2: rgba(8, 10, 15, 0.9);
  --top-bar-height: 56px;
}

body.has-sidebar {
  display: flex !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* When both sidebar and top bar exist, sidebar starts below header */
body.has-sidebar.has-top-status-bar {
  padding-top: var(--top-bar-height) !important;
}

body.has-sidebar .sidebar,
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-2);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 50;
  transition: width var(--sidebar-transition);
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  position: relative;
}

/* When top bar exists, sidebar height adjusts - DESKTOP ONLY (1025px+) */
@media (min-width: 1025px) {
  body.has-top-status-bar .sidebar {
    height: calc(100vh - var(--top-bar-height)) !important;
    position: fixed !important;
    top: var(--top-bar-height) !important;
    left: 0 !important;
  }
}

@media (min-width: 1440px) {
  body.has-sidebar {
    display: flex !important;
    flex-direction: row !important;
  }
  
  body.has-sidebar .sidebar,
  .sidebar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    flex: 0 0 var(--sidebar-width) !important;
    height: 100vh !important;
  }
  
  /* Override for when top bar exists */
  body.has-sidebar.has-top-status-bar .sidebar {
    position: fixed !important;
    top: var(--top-bar-height) !important;
    height: calc(100vh - var(--top-bar-height)) !important;
  }
  
  body.has-sidebar .content {
    flex: 1 !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }
  
  body.has-sidebar.has-top-status-bar .content {
    margin-left: var(--sidebar-width) !important;
  }
  
  body.sidebar-collapsed .sidebar {
    flex: 0 0 var(--sidebar-collapsed-width) !important;
  }
  
  body.sidebar-collapsed.has-top-status-bar .content {
    margin-left: var(--sidebar-collapsed-width) !important;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1rem 0.75rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(247, 160, 15, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: rgba(247, 160, 15, 0.08);
  box-shadow: 0 0 14px rgba(247, 160, 15, 0.3);
  flex-shrink: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.5rem;
  color: var(--tl-primary);
  text-shadow: 0 0 14px hsla(38, 95%, 55%, 0.5);
  letter-spacing: 0.2rem;
  font-weight: 600;
  transition: opacity var(--sidebar-transition);
  white-space: nowrap;
  text-transform: uppercase;
}

/* Beta version badge */
.beta-badge {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 0.48rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.35);
  margin-left: 0.2rem;
}

/* Clickable beta-badge variant — visually identical, but interactive */
button.beta-badge-btn {
  border: none;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button.beta-badge-btn:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.55);
  filter: brightness(1.1);
}
button.beta-badge-btn:active {
  transform: translateY(0) scale(0.98);
}
button.beta-badge-btn:focus-visible {
  outline: 2px solid #ffd86b;
  outline-offset: 2px;
}

/* Top-left corner BETA ribbon — absolutely positioned, doesn't shift logo */
.beta-corner-ribbon {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 60;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: #f3f4f6;
  font-family: 'Orbitron', sans-serif, system-ui;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.beta-corner-ribbon:hover {
  transform: translateY(-1px) scale(1.06);
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  filter: brightness(1.08);
}
.beta-corner-ribbon:active { transform: translateY(0) scale(0.97); }
.beta-corner-ribbon:focus-visible {
  outline: 2px solid #ffd86b;
  outline-offset: 2px;
}

.sidebar-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 6, 9, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: background 0.2s ease, color 0.2s ease, right 0.25s ease;
  z-index: 3;
}

.sidebar-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--sidebar-transition);
}

.sidebar-toggle:hover {
  background: rgba(247, 160, 15, 0.2);
  color: var(--tl-primary);
}

.sidebar-status {
  padding: 0 1.25rem 1.1rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              background 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease;
  text-align: left;
  font-weight: 400;
  text-decoration: none;
  border-radius: 0 6px 6px 0;
}

.nav-btn svg {
  width: 17px;
  height: 17px;
  opacity: 0.55;
  flex-shrink: 0;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-label {
  transition: opacity var(--sidebar-transition);
  white-space: nowrap;
}

.nav-coming-soon {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.55rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 0.4rem;
}

.nav-new-ribbon {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: #000;
  margin-left: 0.35rem;
  animation: pulse-new 2s ease-in-out infinite;
}

@keyframes pulse-new {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 8px 2px rgba(245, 158, 11, 0.3); }
}

.nav-minigame-ribbon {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: #fff;
  margin-left: 0.35rem;
  animation: pulse-minigame 2.4s ease-in-out infinite;
}

@keyframes pulse-minigame {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 8px 2px rgba(139, 92, 246, 0.3); }
}

.nav-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.nav-btn:hover:not(.active) svg {
  opacity: 0.85;
  transform: scale(1.05);
}

.nav-btn:active:not(.active) {
  transform: translateX(2px) scale(0.99);
}

/* ── Inline hover description below label ── */
.nav-btn {
  position: relative;
}

.nav-label-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--sidebar-transition);
}

.nav-label-wrap .nav-label {
  white-space: nowrap;
}

.nav-desc {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
  margin-top: 0;
}

.nav-btn:hover .nav-desc {
  max-height: 1.4em;
  opacity: 1;
  margin-top: 0.1rem;
}

/* ── Inventory inline expandable sub-menu ── */
.nav-item-with-sub {
  position: relative;
}

.nav-submenu-inline {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  padding: 0 0 0 2.2rem;
}

.nav-item-with-sub:hover .nav-submenu-inline {
  max-height: 200px;
  opacity: 1;
  padding: 0.15rem 0 0.15rem 2.2rem;
}

.nav-submenu-item {
  display: flex;
  flex-direction: column;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.55);
  transition: background 0.15s ease, color 0.15s ease;
  gap: 0.1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1px;
}

.nav-submenu-item:hover {
  background: rgba(247, 160, 15, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(247, 160, 15, 0.4);
}

.nav-submenu-item.active {
  background: rgba(247, 160, 15, 0.12);
  color: #fff;
  border-left-color: var(--tl-primary);
}

.nav-submenu-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-submenu-desc {
  font-size: 0.56rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-submenu-item:hover .nav-submenu-desc {
  color: rgba(255, 255, 255, 0.5);
}

/* ── Collapsed sidebar: hide desc & submenu ── */
body.sidebar-collapsed .nav-desc {
  display: none;
}

body.sidebar-collapsed .nav-submenu-inline {
  display: none;
}

body.sidebar-collapsed .nav-label-wrap {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Hide submenu on mobile/tablet */
@media (max-width: 1024px) {
  .nav-submenu-inline {
    display: none !important;
  }
  .nav-desc {
    display: none !important;
  }
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(247, 160, 15, 0.18) 0%, rgba(247, 160, 15, 0.06) 60%, transparent 100%);
  color: #fff;
  border-left-color: var(--tl-primary);
  font-weight: 500;
}

.nav-btn.active svg {
  opacity: 1;
  color: var(--tl-primary);
  filter: drop-shadow(0 0 3px rgba(247, 160, 15, 0.4));
}

.nav-btn.active .nav-label {
  text-shadow: 0 0 8px rgba(247, 160, 15, 0.25);
}

/* Nav radio circles removed - using border-left active indicator instead */

.logout {
  margin: auto 1.5rem 1rem;
  border-radius: 14px;
  padding-block: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.logout-text {
  transition: opacity var(--sidebar-transition);
  white-space: nowrap;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .logo {
  justify-content: center;
  margin: 0 0 1.5rem;
}

body.sidebar-collapsed .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-status {
  display: none;
}

body.sidebar-collapsed .nav-btn {
  justify-content: center;
  padding-inline: 0.75rem;
}

body.sidebar-collapsed .nav-btn svg {
  opacity: 0.9;
}

body.sidebar-collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.sidebar-collapsed .nav-coming-soon {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ── Hover-expand: collapsed sidebar expands on hover (desktop only, not pinned) ── */
@media (min-width: 1025px) {
  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-label,
  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-label-wrap {
    opacity: 1;
    width: auto;
    overflow: visible;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .logo-text {
    opacity: 1;
    width: auto;
    overflow: visible;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .logo {
    justify-content: flex-start;
    margin: 0 1rem 0.75rem;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-btn {
    justify-content: flex-start;
    padding-inline: 1rem;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-coming-soon {
    display: inline-flex;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-toggle svg {
    transform: rotate(0deg);
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .logout-btn-minimal {
    margin: 0.5rem 1rem 0.5rem;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .logout-btn-minimal .logout-text {
    display: inline;
    opacity: 1;
    width: auto;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-online-count {
    padding: 0.35rem 0.75rem;
    margin: 0.25rem 0.75rem 0.5rem;
  }

  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-online-count .online-text,
  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-online-count .online-separator,
  body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-online-count .online-today-text {
    display: inline;
  }
}

/* Pin indicator - small icon next to toggle */
.sidebar-pin-btn {
  position: absolute;
  top: 0.75rem;
  right: 2.25rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 6, 9, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  z-index: 3;
  font-size: 0.65rem;
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-pin-btn {
  opacity: 0;
  pointer-events: none;
}

.sidebar:hover .sidebar-pin-btn,
body.sidebar-pinned .sidebar-pin-btn {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-pin-btn:hover {
  background: rgba(247, 160, 15, 0.2);
  color: var(--tl-primary);
  border-color: rgba(247, 160, 15, 0.4);
}

body.sidebar-pinned .sidebar-pin-btn {
  color: var(--tl-primary);
  border-color: rgba(247, 160, 15, 0.4);
  background: rgba(247, 160, 15, 0.12);
}

body.sidebar-collapsed .logout.btn-destructive {
  justify-content: center;
  align-items: center;
  margin: auto 0.75rem 1rem;
  padding: 0.5rem !important;
  padding-block: 0.5rem !important;
  padding-inline: 0.5rem !important;
  gap: 0 !important;
  min-width: 0;
  width: auto;
  max-width: calc(var(--sidebar-collapsed-width) - 1.5rem);
  display: flex;
}

body.sidebar-collapsed .logout-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.sidebar-collapsed .logout svg {
  width: 16px;
  height: 16px;
  margin: 0;
  display: block;
}

@media (max-width: 1024px) {
  body.sidebar-collapsed .nav-menu {
    display: none !important;
  }

  body.sidebar-collapsed .logout {
    display: none !important;
  }
}


/* 
  TABLET LAYOUT (769px-1024px) - Now using mobile hamburger menu system
  The horizontal scrolling nav was causing glitches on some tablet sizes.
  Mobile-global.css now handles this range with the hamburger menu.
*/

@media (max-width: 1024px) {
  /* Mobile/Tablet layout handled by mobile-global.css hamburger menu system */
  /* Only minimal overrides here - DO NOT conflict with mobile-global.css */
  
  body.has-sidebar {
    flex-direction: column !important;
  }

  /* Sidebar becomes top bar - controlled by mobile-global.css */
  body.has-sidebar .sidebar {
    /* Let mobile-global.css handle positioning */
  }

  body.has-sidebar .logo {
    /* Controlled by mobile-global.css */
  }

  body.has-sidebar .sidebar-toggle {
    display: none !important; /* We use hamburger button instead */
  }

  body.has-sidebar .sidebar-status {
    display: none;
  }

  /* Nav menu is now a slide-in panel - controlled by mobile-global.css */
  /* DO NOT override flex-direction, overflow, position here */

  body.has-sidebar .nav-coming-soon {
    /* Let mobile-global.css handle visibility */
  }

  body.has-sidebar.sidebar-collapsed .sidebar {
    padding: 0.35rem;
  }

  body.has-sidebar.sidebar-collapsed .nav-menu {
    display: flex !important;
  }

  body.has-sidebar.sidebar-collapsed .logout {
    display: none !important;
  }
  
  body.has-sidebar.sidebar-collapsed .logo {
    display: none;
  }

  /* Special buttons - mobile-global.css uses display:contents for proper flow */
  body.has-sidebar .sidebar-special-buttons {
    /* Let mobile-global.css control this with display: contents */
  }
  
  body.has-sidebar .nav-btn-special {
    /* Let mobile-global.css control this */
  }

  /* Logout handled by mobile-global.css */
  body.has-sidebar .logout-btn-minimal {
    /* Let mobile-global.css control this */
  }

  body.has-sidebar .content {
    width: 100%;
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: var(--mobile-header-height, 60px) !important;
  }
  
  /* When both sidebar and top bar exist on mobile/tablet */
  body.has-sidebar.has-top-status-bar .content,
  body.has-sidebar.has-top-status-bar main.content {
    /* Header at top (60px) + small gap */
    padding-top: calc(var(--mobile-header-height, 60px) + 0.5rem) !important;
    /* Use CSS variable for consistent bottom padding */
    padding-bottom: calc(var(--mobile-bottom-total, calc(52px + 44px + env(safe-area-inset-bottom, 0px))) + 1rem) !important;
    margin-left: 0 !important;
  }
}

@media (min-width: 1025px) {
  body.sidebar-collapsed .nav-menu {
    display: flex !important;
  }

  body.sidebar-collapsed .logout {
    display: flex !important;
  }

  body.has-sidebar.sidebar-collapsed .nav-menu {
    display: flex !important;
  }

  body.has-sidebar.sidebar-collapsed .logout {
    display: flex !important;
  }
}

/* Compact sidebar for screens between 1025-1280px to fit all nav items */
@media (min-width: 1025px) and (max-width: 1280px) {
  .sidebar {
    --sidebar-width: 190px;
    width: var(--sidebar-width);
  }
  
  .nav-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    gap: 0.5rem;
  }
  
  .nav-btn svg {
    width: 15px;
    height: 15px;
  }
  
  .nav-coming-soon {
    font-size: 0.5rem;
    padding: 0.08rem 0.4rem;
    letter-spacing: 0.15rem;
  }
  
  .sidebar-status {
    padding: 0 0.75rem 0.6rem;
  }
  
  .logo {
    margin: 0 0.75rem 0.5rem;
  }
  
  .logo-mark {
    width: 28px;
    height: 28px;
  }
  
  .logo-text {
    font-size: 0.45rem;
  }
  
  .logout.btn-destructive {
    margin: auto 0.75rem 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* Special Action Buttons - Get TLRPG & Get VIP */
.sidebar-special-buttons {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Style the special nav buttons to match other nav items */
.nav-btn-special {
  position: relative;
}

.nav-btn-special.btn-get-tlrpg svg {
  color: #10b981;
}

.nav-btn-special.btn-get-vip svg {
  color: #eab308;
}

.nav-btn-special.btn-referrals svg {
  color: rgba(255, 255, 255, 0.7);
}

.nav-btn-special.btn-get-tlrpg:hover svg,
.nav-btn-special.btn-get-tlrpg.active svg {
  color: #34d399;
}

.nav-btn-special.btn-get-vip:hover svg,
.nav-btn-special.btn-get-vip.active svg {
  color: #facc15;
}

.nav-btn-special.btn-referrals:hover svg,
.nav-btn-special.btn-referrals.active svg {
  color: rgba(255, 255, 255, 0.9);
}

.nav-btn-special.btn-referrals {
  background: transparent;
  border: none;
}

.nav-btn-special.btn-referrals:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn-special.btn-blocklords svg {
  color: #8b5cf6;
}

.nav-btn-special.btn-blocklords:hover svg,
.nav-btn-special.btn-blocklords.active svg {
  color: #a78bfa;
}

/* Control Panel button (permissioned item) */
.control-panel-btn {
  position: relative;
  margin-top: 0.35rem;
}

.control-panel-btn svg {
  color: #f7a00f;
}

.control-panel-btn:hover svg,
.control-panel-btn.active svg {
  color: #fbbf24;
}

.control-panel-btn::after {
  content: 'STAFF';
  margin-left: auto;
  font-size: 0.55rem;
  letter-spacing: 0.08rem;
  font-weight: 700;
  color: rgba(247, 160, 15, 0.9);
  background: rgba(247, 160, 15, 0.12);
  border: 1px solid rgba(247, 160, 15, 0.28);
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
}

body.sidebar-collapsed .control-panel-btn::after {
  display: none;
}

/* Glowing animation for attention */
@keyframes navButtonGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.2);
  }
}

@keyframes navButtonGlowGreen {
  0%, 100% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6), 0 0 30px rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.8);
  }
}

@keyframes navButtonGlowGold {
  0%, 100% {
    box-shadow: 0 0 5px rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.6), 0 0 30px rgba(234, 179, 8, 0.3);
    border-color: rgba(234, 179, 8, 0.8);
  }
}

.nav-btn-special.btn-get-tlrpg.nav-btn-glow {
  animation: navButtonGlowGreen 1.5s ease-in-out infinite;
  background: rgba(16, 185, 129, 0.1);
}

.nav-btn-special.btn-get-tlrpg.nav-btn-glow svg {
  color: #34d399;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
}

.nav-btn-special.btn-get-vip.nav-btn-glow {
  animation: navButtonGlowGold 1.5s ease-in-out infinite;
  background: rgba(234, 179, 8, 0.1);
}

.nav-btn-special.btn-get-vip.nav-btn-glow svg {
  color: #facc15;
  filter: drop-shadow(0 0 4px rgba(234, 179, 8, 0.6));
}

/* Minimal logout button - outline style */
.logout-btn-minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem 1rem 0.5rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: rgba(239, 68, 68, 0.7);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn-minimal svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.logout-btn-minimal:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
}

.logout-btn-minimal:hover svg {
  opacity: 1;
}

body.sidebar-collapsed .sidebar-special-buttons {
  padding: 0;
  border-top: none;
}

body.sidebar-collapsed .logout-btn-minimal {
  margin: 0.75rem;
  padding: 0.5rem;
  justify-content: center;
}

body.sidebar-collapsed .logout-btn-minimal .logout-text {
  display: none;
}

/* Online Count Indicator */
.sidebar-online-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  margin: 0.25rem 0.75rem 0.5rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.online-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-online 2s infinite;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

@keyframes pulse-online {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.online-text {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.online-separator {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.5rem;
}

.online-today-text {
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.4);
}

body.sidebar-collapsed .sidebar-online-count {
  padding: 0.5rem;
  margin: 0.5rem 0.5rem 1rem;
}

body.sidebar-collapsed .sidebar-online-count .online-text {
  display: none;
}

body.sidebar-collapsed .sidebar-online-count .online-separator {
  display: none;
}

body.sidebar-collapsed .sidebar-online-count .online-today-text {
  display: none;
}

/* Mobile responsive for special buttons */
@media (max-width: 1024px) {
  .sidebar-special-buttons {
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .logout-btn-minimal {
    margin: 0 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  
  .logout-btn-minimal svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 1024px) {
  /* Let mobile-global.css handle the logout button styling */
  .logout-btn-minimal .logout-text {
    /* Controlled by mobile-global.css */
  }
  
  .logout-btn-minimal {
    /* Controlled by mobile-global.css */
  }
  
  /* Don't override special buttons on mobile - mobile-global.css handles this */
  .sidebar-special-buttons {
    /* Controlled by mobile-global.css for hamburger menu */
  }
}

/* =====================================================
   GLOBAL MODAL CENTERING FIX
   Ensures modals are centered on the full viewport,
   not offset by sidebar
   ===================================================== */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  margin: 0 !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

.modal-overlay .modal,
.modal-overlay > div:not(.modal) {
  margin: 0 auto !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

/* =====================================================
   GLOBAL LOADING OVERLAY
   Full-screen loading overlay with glow spinner
   ===================================================== */
.global-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.global-loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.global-loading-overlay .glow-loader {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(45deg, transparent, transparent 40%, #e5f403);
  animation: glow-spin 2s linear infinite;
}

@keyframes glow-spin {
  0% {
    transform: rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

.global-loading-overlay .glow-loader::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: #212121;
  border-radius: 50%;
  z-index: 1000;
}

.global-loading-overlay .glow-loader::after {
  content: "";
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  background: linear-gradient(45deg, transparent, transparent 40%, #e5f403);
  border-radius: 50%;
  z-index: 1;
  filter: blur(30px);
}

.global-loading-overlay .loading-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =====================================================
   NOTIFICATION BELL ANIMATION
   Pulsing green dot with ring animation
   ===================================================== */
.notification-indicator {
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  background-color: rgb(0, 255, 0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-indicator::before {
  content: "";
  position: absolute;
  width: 1px;
  height: 1px;
  background-color: rgb(0, 255, 0);
  border-radius: 50%;
  animation: notification-pulse 1s infinite;
}

@keyframes notification-pulse {
  0% {
    background-color: rgb(0, 255, 0);
    width: 1px;
    height: 1px;
  }
  100% {
    background-color: rgba(0, 255, 0, 0);
    width: 30px;
    height: 30px;
  }
}

/* Bell shake animation when notification is present */
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
  20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.has-notification .bell-icon {
  animation: bell-ring 0.5s ease-in-out;
  animation-iteration-count: 3;
}

/* =====================================================
   SERVER UPDATE OVERLAY
   Orange rings animation for server updates
   ===================================================== */
.update-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.update-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.update-overlay .rings-loader {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.update-overlay .ring {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid transparent;
  border-radius: 50%;
  border-bottom: 6px solid var(--ring-color, #f97316);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}

.update-overlay .ring:nth-child(1) {
  --ring-color: #f97316;
  animation: ring-rotate1 1s ease-in-out infinite;
}

.update-overlay .ring:nth-child(2) {
  --ring-color: #fb923c;
  animation: ring-rotate2 1s ease-in-out infinite;
}

.update-overlay .ring:nth-child(3) {
  --ring-color: #fdba74;
  animation: ring-rotate3 1s ease-in-out infinite;
}

.update-overlay .ring:nth-child(4) {
  --ring-color: #f97316;
  width: 250px;
  height: 250px;
  border-width: 2px;
  border-bottom-width: 10px;
  animation: ring-rotate4 1s ease-in-out infinite;
}

.update-overlay .ring:nth-child(5) {
  --ring-color: #fb923c;
  width: 250px;
  height: 250px;
  border-width: 2px;
  border-bottom-width: 10px;
  animation: ring-rotate5 1s ease-in-out infinite;
}

.update-overlay .ring:nth-child(6) {
  --ring-color: #fdba74;
  width: 250px;
  height: 250px;
  border-width: 2px;
  border-bottom-width: 10px;
  animation: ring-rotate6 1s ease-in-out infinite;
}

@keyframes ring-rotate1 {
  from { transform: rotateX(50deg) rotateZ(110deg); }
  to { transform: rotateX(50deg) rotateZ(470deg); }
}

@keyframes ring-rotate2 {
  from { transform: rotateX(20deg) rotateY(50deg) rotateZ(20deg); }
  to { transform: rotateX(20deg) rotateY(50deg) rotateZ(380deg); }
}

@keyframes ring-rotate3 {
  from { transform: rotateX(40deg) rotateY(130deg) rotateZ(450deg); }
  to { transform: rotateX(40deg) rotateY(130deg) rotateZ(90deg); }
}

@keyframes ring-rotate4 {
  from { transform: rotateX(50deg) rotateZ(470deg); }
  to { transform: rotateX(50deg) rotateZ(110deg); }
}

@keyframes ring-rotate5 {
  from { transform: rotateX(20deg) rotateY(50deg) rotateZ(380deg); }
  to { transform: rotateX(20deg) rotateY(50deg) rotateZ(20deg); }
}

@keyframes ring-rotate6 {
  from { transform: rotateX(40deg) rotateY(130deg) rotateZ(90deg); }
  to { transform: rotateX(40deg) rotateY(130deg) rotateZ(450deg); }
}

.update-overlay .nucleus {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, #f97316, #ea580c);
  border-radius: 50%;
  box-shadow: 0px 0 20px #f97316, 0 0 40px #fb923c;
  animation: nucleus-pulse 1s ease-in-out infinite;
}

@keyframes nucleus-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px #f97316, 0 0 40px #fb923c;
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 30px #f97316, 0 0 60px #fb923c;
  }
}

.update-overlay .update-text {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
}

.update-overlay .update-subtext {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ============================================================================
   PAGE LOADER - Animated loading state for all pages
   ============================================================================ */

.page-loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  width: 100%;
}

.loader-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  user-select: none;
  gap: 10px;
}

.loader {
  width: 20px;
  height: 20px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: transparent;
  animation: loader-rotate 1.5s linear infinite;
  z-index: 0;
}

@keyframes loader-rotate {
  0% {
    transform: rotate(90deg);
    box-shadow:
      0 1px 1px 0 #fff inset,
      0 3px 5px 0 #ff5f9f inset,
      0 4px 4px 0 #0693ff inset;
  }
  50% {
    transform: rotate(270deg);
    background: #7c0911;
    box-shadow:
      0 1px 1px 0 #fff inset,
      0 3px 5px 0 #d60a47 inset,
      0 4px 4px 0 #fbef19 inset;
  }
  100% {
    transform: rotate(450deg);
    box-shadow:
      0 1px 1px 0 #fff inset,
      0 3px 5px 0 #ff5f9f inset,
      0 4px 4px 0 #28a9ff inset;
  }
}

.letter-wrapper {
  display: flex;
  gap: 1px;
}

.loader-letter {
  display: inline-block;
  opacity: 0.4;
  transform: translateY(0);
  animation: loader-letter-anim 2s infinite;
  z-index: 1;
  border-radius: 50ch;
  border: none;
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
}

@keyframes loader-letter-anim {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
    transform: scale(1.15);
  }
  40% {
    opacity: 0.7;
    transform: translateY(0);
  }
}

/* ── Limited-time event ribbon (e.g. Event - BJ) ───────────────── */
.nav-limited-ribbon {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.09rem;
  text-transform: uppercase;
  color: #fff;
  margin-left: 0.35rem;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 10px -4px rgba(239,68,68,.55);
  animation: pulse-limited 1.6s ease-in-out infinite;
}
@keyframes pulse-limited {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
  50%      { transform: scale(1.06); box-shadow: 0 0 10px 3px rgba(239,68,68,.45); }
}
.nav-btn-limited {
  position: relative;
}
.nav-btn-limited::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(239,68,68,.10), rgba(239,68,68,0) 60%);
  pointer-events: none;
}

