/* Layout: Sidebar + slim top navbar */
.app-layout {
  display: flex;
  flex-direction: column;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Top navbar - login/info only */
.top-navbar {
  flex-shrink: 0;
  border-bottom: 1px solid var(--transparent-5-w);
  padding: 0.5rem 1rem;
  top: 0;
  z-index: 100;
}

.top-navbar_inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.top-navbar_left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar_toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--br-5);
}

.sidebar_toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-custom);
  transition: all 0.3s;
}

.sidebar_toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.sidebar_toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar_toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.top-navbar_logo {
  font-size: var(--font-size-l);
  font-weight: var(--font-weight-7);
  color: var(--text-custom);
  text-decoration: none;
  transition: color 0.2s;
}

.top-navbar_logo:hover {
  color: var(--span);
}

.top-navbar_actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.top-navbar_login {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-default);
  border: none;
  border-radius: var(--br-8);
  font-weight: var(--font-weight-6);
  cursor: pointer;
  transition: opacity 0.2s;
}

.top-navbar_login:hover {
  opacity: 0.9;
}

.top-navbar_login svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Top navbar online players stat (like mini stat block) */
.top-navbar_online {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--br-8);
}

.top-navbar_online_icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-navbar_online_icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.top-navbar_online_info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.top-navbar_online_label {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.6);
  font-weight: var(--font-weight-4);
}

.top-navbar_online_count {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-7);
  color: #fff;
  line-height: 1.2;
}

/* Layout body: sidebar + main content */
.layout-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Main sidebar */
.main-sidebar {
  width: 248px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  padding: 1rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  overflow-y: auto;
}

/* Sidebar online stats */
.sidebar_online {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--transparent-5-w);
  margin-bottom: 0.75rem;
}

.sidebar_online_icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--span-low);
  border-radius: var(--br-10);
}

.sidebar_online_icon svg {
  width: 26px;
  height: 26px;
  fill: var(--span);
}

.sidebar_online_info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar_online_label {
  font-size: var(--font-size-s);
  color: var(--span-half);
}

.sidebar_online_count {
  font-size: var(--font-size-xxl);
  font-weight: var(--font-weight-7);
  color: var(--text-custom);
}

/* Sidebar nav */
.sidebar_nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.7rem;
  flex: 0 0 auto;
  min-height: 0;
}

.sidebar_nav_section {
  margin: 0.9rem 0.55rem 0.3rem;
  padding: 0;
  font-size: 0.68rem;
  font-weight: var(--font-weight-6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.2;
}

.sidebar_nav_section:first-child {
  margin-top: 0.15rem;
}

.sidebar_nav_item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.42rem 0.55rem 0.42rem 0.6rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--br-8);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar_nav_item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  transform: translateX(3px);
}

.sidebar_nav_item:hover .sidebar_nav_icon {
  color: var(--span);
}

.sidebar_nav_item:hover .sidebar_nav_icon svg {
  fill: currentColor;
  opacity: 1;
}

.sidebar_nav_item.active {
  background: rgba(204, 157, 66, 0.12);
  color: #fff;
  font-weight: var(--font-weight-6);
  transform: none;
}

.sidebar_nav_item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 2px;
  background: #cc9d42;
}

.sidebar_nav_item.active .sidebar_nav_icon {
  background: linear-gradient(145deg, #d4a84b 0%, #b8860b 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(204, 157, 66, 0.22);
}

.sidebar_nav_item.active .sidebar_nav_icon svg {
  fill: #fff;
  opacity: 1;
}

.sidebar_nav_icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--br-6);
  color: inherit;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar_nav_icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.82;
  transition: opacity 0.2s ease, fill 0.2s ease;
}

.sidebar_nav_item span {
  font-size: 0.92rem;
  font-weight: inherit;
  flex: 1;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* Sidebar footer – quiet strip under nav */
.sidebar-footer {
  margin-top: 0.35rem;
  padding: 0.5rem 1rem 1rem;
  flex-shrink: 0;
}

.sidebar-footer__card {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 1rem 0.35rem 0;
}

.sidebar-footer__sitename {
  display: block;
  font-size: var(--font-size-m);
  font-weight: var(--font-weight-7);
  color: var(--text-default);
  text-decoration: none;
  margin-bottom: 0.55rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.sidebar-footer__sitename:hover {
  color: var(--span);
}

.sidebar-footer__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

.sidebar-footer__links a {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-5);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-footer__links a:hover {
  color: #fff;
}

.sidebar-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.sidebar-footer__social-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--br-6);
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.sidebar-footer__social-btn:hover {
  background: rgba(204, 157, 66, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.sidebar-footer__social-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.sidebar-footer__divider {
  display: none;
}

.sidebar-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.65rem 0.35rem 0;
}

.sidebar-footer__desc {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-4);
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  line-height: 1.4;
  max-width: 100%;
  word-break: break-word;
}

.sidebar-footer__watermark {
  font-size: 0.65rem;
  font-weight: var(--font-weight-5);
  color: rgba(255, 255, 255, 0.28);
}

/* Main content area */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 1rem;
}

.main-content .container-fluid {
  padding: 0;
  max-width: 100%;
}

/* Mobile: collapse sidebar */
@media (max-width: 768px) {
  .app-layout {
    padding: 0 0.5rem;
  }
  .sidebar_toggle {
    display: flex;
  }

  .main-sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 260px;
    max-height: none;
    align-self: auto;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    background-color: rgb(13 17 24);
  }

  .main-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 85;
    top: 56px;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .main-content {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 576px) {
  .app-layout {
    padding: 0;
  }
}
