/* =========================================
   FREE FIRE SETTINGS - GLOBAL HEADER
   Responsive desktop and mobile navigation
========================================= */

.topbar,
.topbar *,
.topbar *::before,
.topbar *::after {
  box-sizing: border-box;
}

/* =========================================
   HEADER
========================================= */

.topbar {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 20px;
  width: 100%;
  min-height: 76px;
  padding: 18px max(24px, calc((100% - 1440px) / 2));
  background: #080b12;
  border-bottom: 1px solid #202a38;
  backdrop-filter: none;
}

/* =========================================
   BRAND
========================================= */

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.topbar .brand .accent {
  color: #ffab22;
}

/* =========================================
   DESKTOP NAVIGATION
========================================= */

.topbar nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 22px;
  min-width: 0;
}

.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  color: #c4cede;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
  color: #ffab22;
}

.topbar nav a[aria-current="page"] {
  font-weight: 700;
}

/* =========================================
   MOBILE MENU BUTTON
========================================= */

.topbar .menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #151e2b;
  border: 1px solid #344153;
  border-radius: 11px;
  color: #ffab22;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.topbar .menu-toggle:hover {
  background: #1c2838;
  border-color: #ffab22;
}

.topbar .menu-toggle[aria-expanded="true"] {
  background: #1c2838;
  border-color: #ffab22;
}

/* =========================================
   KEYBOARD FOCUS
========================================= */

.topbar .brand:focus-visible,
.topbar .menu-toggle:focus-visible,
.topbar nav a:focus-visible {
  outline: 3px solid #ffab22;
  outline-offset: 3px;
}

/* =========================================
   TABLET AND MOBILE
========================================= */

@media (max-width: 1050px) {
  .topbar {
    min-height: 70px;
    padding: 13px 18px;
    gap: 0 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .topbar .brand {
    flex: 1 1 0;
    font-size: clamp(15px, 3.7vw, 19px);
    white-space: normal;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .topbar .menu-toggle {
    display: inline-flex;
  }

  /*
    Navigation remains visible when JavaScript
    has not added a menu button.
  */

  .topbar nav {
    display: flex;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 13px 0 0;
    padding: 13px 0 3px;
    border-top: 1px solid #283446;
  }

  /*
    Once the menu button exists, JavaScript
    opens the navigation using the active class.
  */

  .topbar:has(.menu-toggle) nav:not(.active) {
    display: none;
  }

  .topbar nav.active {
    display: flex;
  }

  .topbar nav a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 13px 15px;
    border-radius: 10px;
    color: #c4cede;
    font-size: 14px;
    text-align: start;
  }

  .topbar nav a:hover,
  .topbar nav a[aria-current="page"] {
    background: #172131;
    color: #ffab22;
  }
}

/* =========================================
   VERY SMALL PHONES
========================================= */

@media (max-width: 360px) {
  .topbar {
    padding: 12px;
    column-gap: 8px;
  }

  .topbar .brand {
    font-size: 14px;
  }

  .topbar .menu-toggle {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
  .topbar nav a,
  .topbar .menu-toggle {
    transition: none;
  }
}