* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

:root {
  --main-font: 'Inter', sans-serif;
  --main-color: #fba4a4;
  --second-color: #fd5e5e;
  --background-color: #24272B;
  --white-color: #FFFFFF;
  --black-color: #000000;
  --description-color: #D2D0D0;

  --green-color: #4AFF6B;
  --ip-copied-background: rgba(74, 255, 107, 0.17);
  --ip-copied-icon-background: rgba(74, 255, 107, 0.5);

  --copy-ip-button-background: rgba(251, 164, 164, 1);
  --how-to-join-button-background: rgba(210, 208, 208, 0.2);
  --stats-background: rgba(210, 208, 208, 0.05);
  --stat-icon-background-2: rgba(253, 94, 94, 1);

  --scroll-bar: rgba(210, 208, 208, 0.3);
  --scroll-bar-hover: #555555FF;

  --red-color: #FF7C7C;
  --warning-background: rgba(255, 124, 124, 0.17);
  --warning-icon-background: rgba(255, 124, 124, 0.5);
  --warning-color: #F5C1C1;

  /*Admin-Team rank colors*/
  --default-rank-color: rgba(210, 208, 208, 0.3);
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  background: var(--background-color);
  font-family: var(--main-font);
}

.section-title,
.rules-title,
.rank-title {
  width: fit-content;
  max-width: 100%;
}

#header {
  position: relative;
}

/* Mobile browsers (esp. iOS) zoom fixed backgrounds incorrectly */
@media screen and (max-width: 819px) {
  #header,
  #discord {
    background-attachment: scroll !important;
  }
}

.header-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

#header > .content {
  position: relative;
  z-index: 2;
}

/*Navbar*/
.navbar {
  display: flex;
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 20px 150px;
  background: var(--background-color);
  transition: 0.3s ease-in-out;
  position: relative;
  z-index: 1000;
}

.navbar a {
  text-decoration: none;
}

.navbar .menu-mobile {
  display: contents;
}

.navbar .menu-mobile > a {
  display: flex;
  align-items: center;
}

.navbar .menu-mobile .logo {
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
  gap: 10px;
}

.navbar .menu-mobile .logo img {
  max-width: 40px;
  height: auto;
}

.navbar .menu-mobile .logo h3 {
  color: var(--white-color);
  font-weight: 900;
  font-size: 20px;
}

.navbar .menu-mobile-actions {
  display: contents;
}

.navbar .nav-switcher {
  display: contents;
}

.navbar .links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 30px;
  transition: 0.3s ease-in-out;
  order: 2;
  margin-left: auto;
  margin-right: 20px;
}

.navbar .links .link {
  color: var(--description-color);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: 0.2s;
}

.navbar .links .link.active {
  color: var(--white-color);
}

.navbar .links .link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: calc(100% - 16px);
  height: 3px;
  border-radius: 5px;
  background: var(--main-color);
  transform: translateX(-50%);
}

.navbar .links .link:not(.active):hover {
  color: var(--white-color);
}

/*Language switcher*/
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 1001;
  order: 3;
}

.lang-switcher .lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stats-background);
  border: 1px solid rgba(210, 208, 208, 0.15);
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--description-color);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--main-font);
  cursor: pointer;
  transition: 0.2s;
}

.lang-switcher .lang-toggle:hover {
  color: var(--white-color);
  border-color: var(--main-color);
}

.lang-switcher .lang-toggle .lang-globe {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lang-switcher .lang-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-top: -4px;
}

.lang-switcher.open .lang-toggle .lang-arrow {
  margin-top: 2px;
  transform: rotate(225deg);
}

.lang-switcher .lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--background-color);
  border: 1px solid rgba(210, 208, 208, 0.15);
  border-radius: 8px;
  padding: 6px;
  margin: 0;
  list-style: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: 0.2s;
  z-index: 9999;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-switcher .lang-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--description-color);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--main-font);
  cursor: pointer;
  transition: 0.15s;
}

.lang-switcher .lang-option:hover {
  background: var(--stats-background);
  color: var(--white-color);
}

.lang-switcher .lang-option.active {
  color: var(--main-color);
  font-weight: 700;
}

/* Стили для бургер-меню */
.navbar .menu-mobile .hamburger {
  display: none; /* По умолчанию скрыто */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  background: var(--stats-background);
  border: 1px solid rgba(210, 208, 208, 0.15);
  border-radius: 5px;
  padding: 0;
  color: var(--description-color);
  transition: 0.2s;
}

.navbar .menu-mobile .hamburger:hover {
  color: var(--white-color);
  border-color: var(--main-color);
}

.navbar .menu-mobile .hamburger span {
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: 0.3s;
}

/* Мобильная версия */
@media screen and (max-width: 867px) {
  .navbar {
    padding: 20px 30px;
    overflow: visible;
  }

  .navbar .menu-mobile {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .navbar .menu-mobile-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 10001;
  }

  .navbar .nav-switcher {
    display: flex;
    position: relative;
    align-items: center;
    z-index: 10001;
  }

  .navbar .menu-mobile .hamburger {
    display: flex;
    width: 36px;
    height: 36px;
  }

  .navbar .links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 170px;
    width: max-content;
    margin: 0;
    padding: 6px;
    background: var(--background-color);
    border: 1px solid rgba(210, 208, 208, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: 0.2s;
    z-index: 10002;
    order: unset;
    text-align: left;
  }

  .navbar.active .links,
  .nav-switcher.open .links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .navbar .links .link {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
  }

  .navbar .links .link.active {
    color: var(--main-color);
    font-weight: 700;
  }

  .navbar .links .link.active::after {
    display: none;
  }

  .navbar .links .link:not(.active):hover,
  .navbar .links .link:hover {
    background: var(--stats-background);
    color: var(--white-color);
  }

  .lang-switcher {
    z-index: 10001;
    order: unset;
  }

  .lang-switcher .lang-toggle {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    gap: 6px;
    justify-content: center;
  }

  .lang-switcher .lang-toggle .lang-globe {
    width: 15px;
    height: 15px;
  }

  .lang-switcher .lang-toggle .lang-current-code {
    font-size: 13px;
    line-height: 1;
  }

  .lang-switcher .lang-dropdown {
    right: 0;
    left: auto;
    z-index: 10002;
  }

  /* Анимация бургер-меню */
  .navbar.active .hamburger span:nth-child(1),
  .nav-switcher.open .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(4.5px, 4.5px);
  }

  .navbar.active .hamburger span:nth-child(2),
  .nav-switcher.open .hamburger span:nth-child(2) {
    opacity: 0;
  }

  .navbar.active .hamburger span:nth-child(3),
  .nav-switcher.open .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(4.5px, -4.5px);
  }
}

/* Очень маленькие экраны */
@media screen and (max-width: 320px) {
  .navbar {
    padding: 15px 20px;
  }

  .navbar .menu-mobile .logo h3 {
    font-size: 18px;
  }
}

@media screen and (max-width: 280px) {
  .navbar {
    padding: 12px 15px;
  }

  .navbar .menu-mobile .logo h3 {
    font-size: 16px;
  }
}

@media screen and (max-width: 240px) {
  .navbar {
    padding: 10px 12px;
  }

  .navbar .menu-mobile .logo h3 {
    font-size: 14px;
  }
}

/*Footer*/
#footer {
  padding: 20px 150px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#footer p {
  color: var(--description-color);
  font-size: 17px;
}

#footer p span {
  color: inherit;
}

#footer .social-links {
  display: flex;
  flex-direction: row;
  gap: 15px;
}

#footer .social-links .link {
  color: var(--description-color);
  text-decoration: none;
  font-size: 20px;
  transition: 0.2s;
}

#footer .social-links .link:hover {
  color: var(--white-color);
}

/* Footer responsive */
@media screen and (max-width: 819px) {
  #footer {
    padding: 12px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  #footer p {
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }

  #footer .social-links {
    flex-shrink: 0;
    gap: 10px;
  }

  #footer .social-links .link {
    font-size: 16px;
  }
}

@media screen and (max-width: 380px) {
  #footer {
    padding: 10px 14px;
    gap: 8px;
  }

  #footer p {
    font-size: 11px;
  }

  #footer .social-links {
    gap: 8px;
  }

  #footer .social-links .link {
    font-size: 15px;
  }
}

/*Scrollbar*/
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--stats-background);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-bar);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-bar-hover);
}

/*Other*/
section:not(#header) .content {
  padding: 90px 150px;
  width: 100%;
}

/*Responsive*/
@media screen and (max-width: 1625px) {
  .navbar {
    padding: 20px 90px;
  }

  section:not(#header) .content {
    padding: 90px;
  }

  #footer {
    padding: 20px 90px;
  }
}

@media screen and (max-width: 819px) {
  .navbar {
    padding: 20px 30px;
  }

  section:not(#header) .content {
    padding: 50px 30px;
  }

  #footer {
    padding: 12px 20px;
  }
}

@media screen and (max-width: 564px) {
  #footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }
}

/* Очень маленькие экраны для всех секций */
@media screen and (max-width: 320px) {
  section:not(#header) .content {
    padding: 40px 20px;
  }
}

@media screen and (max-width: 280px) {
  section:not(#header) .content {
    padding: 35px 15px;
  }
}

@media screen and (max-width: 240px) {
  section:not(#header) .content {
    padding: 30px 12px;
  }
}